Allocations and releases on Heap

Hello,

I am allocating and releasing the memory at large scale during initialization of my program. All the memory allocated has been completely released and then also memory analysis in qnx and other utilities are showing the memory allocated on heap and not released to system.
I think Process is not releasing all the memory to the OS . But the memory kept is very large and cannot afford for that much memory .

Please help me with releasing the memory to the OS from heap.

If i try with sample app and run it without doing anything it shows more than 64k of memory on heap.

I try to limit the memory with mallopt() but it is affecting other heap blocks of the process , but not all of them.

Thanks in Advance.

Which version of QNX are using. In “older” that was the behavior, head is never shrinked ( which is often what you want in a real-time system). In more recent version ( 6.4.1 ) that has changed. This is is controled via environment variable MALLOC_MEMORY_HOLD.