marco.stanzani
9th March 2012, 15:32
hello
i am running into trouble with an application which work perfectly for some time, and the it locks as long as a number of iteration has been executed: i am suspecting memory leakage since this number is depending on the memory available on my (windows XP) PC: on machine A (2G RAM) it takes 12 to 18 iterations on average, on machine B (4 G RAM) it takes approx 50 iterations. When looking a t the Windows task manager I can also observe that memory is slowly growing as long as the number of iterations
'Lock' happens as soon as the program 'start' a certain thread: 'lock' happens since thread never start (supposedly because the thead cannot get free memory to operate)
I checked my code and
- storage is either static or 'automatic' (variable decalred inside the functions)
- 'new' objects are seldomly declared and promptly 'deleted' when non necessary
- *alloc functions are never used during the run time, but only during the initialization of the program (only one time!!)
I suspect that the issue may be due to the fact that I have a thread which makes the UART communicating with the main application and using many 'emit': is this an issue? should i take any countermeasure for this?
i am also looking for a way to 'profile' the application memory usage, please advice: Is there under visual studio a way to check / monitoring the memory and class allocation used by the program or thread?
sorry for not posting any code example: the program is quite complex and probably will not help
thanks in advance for your help
i am running into trouble with an application which work perfectly for some time, and the it locks as long as a number of iteration has been executed: i am suspecting memory leakage since this number is depending on the memory available on my (windows XP) PC: on machine A (2G RAM) it takes 12 to 18 iterations on average, on machine B (4 G RAM) it takes approx 50 iterations. When looking a t the Windows task manager I can also observe that memory is slowly growing as long as the number of iterations
'Lock' happens as soon as the program 'start' a certain thread: 'lock' happens since thread never start (supposedly because the thead cannot get free memory to operate)
I checked my code and
- storage is either static or 'automatic' (variable decalred inside the functions)
- 'new' objects are seldomly declared and promptly 'deleted' when non necessary
- *alloc functions are never used during the run time, but only during the initialization of the program (only one time!!)
I suspect that the issue may be due to the fact that I have a thread which makes the UART communicating with the main application and using many 'emit': is this an issue? should i take any countermeasure for this?
i am also looking for a way to 'profile' the application memory usage, please advice: Is there under visual studio a way to check / monitoring the memory and class allocation used by the program or thread?
sorry for not posting any code example: the program is quite complex and probably will not help
thanks in advance for your help