QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Allocated memory is not returned after calling free() |
Ref. No. |
QNX.000008524 |
Category(ies) |
Development |
Issue |
Memory was allocated in QNX4 with malloc(). When free() is called, its not returned, not made available for use. Compiling is with Watcom 10.6. |
Solution |
The heap for the program has not shrunk. The memory is no longer used, but the heap is still claiming it. This allows for speeding up the process of allocating memory in the future since malloc won't have to do as many system calls to get the heap to a larger size again: its already there. But it can be a pain if the memory is needed somewhere else.
To shrink the heap use _heapshrink().
See Also: free in Watcom C Reference - A to M See Also: _heapshrink in Watcom C Reference - A to M |
|