I am debugging an application on an embedded PPC design. For devolopment of the application and the debugging I am using the QNX
Momentics IDE. My problem is that when I start and stop my application several times that I debugging then my application detects there there is not enough free memory. Every time my app allocates the total free memory on my system minus 100kB. But after several start/stops my app detects at start that there is not enough free memory to start and I generate en error. I assume that when I “Terminate/Remove” my app that QNX Neutrino releases all the memory it had used, but that seens not to be the case. Has anybody a hint what could cause this effect.
What you are seeing is probably the effect of memory fragmentation. Although there could be 200Meg of memory free it doesn’t mean you can allocated it in one block. In most cases virtual memory will take care of that problem, in theory it should work, however in practice its not perfect.
Depending how you detect the amount of free ram and the status of the program heap, allocating say 1M could actually end up sending the OS a request of a tad more then 1M.
Asking for all the memory minus 100ks is kind of dangerous, because while you are debugging the application, qconn or any other application already running in the system might run out ram.