Global variables: loosing the value

Sorry if I posted few code but the sketch is very big.....

I think this can help more:

this is the declaration part...
in this way the code is working seems without problem......

//Classi
Parameters pars;
Flags flags;
ComPc comPc;

float Debug;

//Valori calcolati e di movimanto
int motHEma = 0;
int motO2ma = 0;
int lettureSensori = 0;
float letPrecHe = 0;
float letPrecO2 = 0;
float letPrecCorHe = 0;
float letPrecCorO2 = 0;
long valoreLettureHe = 0;
long valoreLettureO2 = 0;
long valoreLettureCorHe = 0;
long valoreLettureCorO2 = 0;
float movingPrecLetHe = 0;
float movingPrecLetO2 = 0;
int timeToMovePrecHE = 0;
int timeToMovePrecO2 = 0;

//Luce di debug
bool DebugStatus = false;
bool SpeedPin = false;

//Ora interna
int Ora;
int Minuto;
int Secondo;
int Millisecondo = 0;

//Ingressi
bool iStart = false;
bool iStop = false;
bool iCalibrate = false;
bool Inp4 = false;
bool Inp5 = false;
bool Inp6 = false;
bool Inp7 = false;
bool Inp8 = false;
//Uscite
int OutPutsA = 0;
bool OSicurezzaO2 = false;
bool OStart = false;
bool OStop = false;
bool OCalibrate = false;
bool Out5 = false;
bool Out6 = false;
bool Out7 = false;
bool Out8 = false;

//Timers
unsigned long LastTimeLoop;

//Gestione timers
int const MaxTimers = 20;

int Ore[MaxTimers];
int Minuti[MaxTimers];
int Secondi[MaxTimers];
int Millisecondi[MaxTimers];
int TimerName[MaxTimers];
int TimerEnabled[MaxTimers];

..... but if I move the last 7 rows a little bit up the values of the variables declared after the arrays declaration can be loosed....

so if I declare this...

//Timers
unsigned long LastTimeLoop;

//Gestione timers
int const MaxTimers = 20;

int Ore[MaxTimers];
int Minuti[MaxTimers];
int Secondi[MaxTimers];
int Millisecondi[MaxTimers];
int TimerName[MaxTimers];
int TimerEnabled[MaxTimers];

... before this...

//Ingressi
bool iStart = false;
bool iStop = false;
bool iCalibrate = false;
bool Inp4 = false;
bool Inp5 = false;
bool Inp6 = false;
bool Inp7 = false;
bool Inp8 = false;
//Uscite
int OutPutsA = 0;
bool OSicurezzaO2 = false;
bool OStart = false;
bool OStop = false;
bool OCalibrate = false;
bool Out5 = false;
bool Out6 = false;
bool Out7 = false;
bool Out8 = false;

..... the last 16 variables are offten loosed....

about the use of the RAM i'm checking with this function during the cycle: and there are always more than 50% RAM free....

/*


freeRam


*/
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}

Thanks again guys...