Heap management
Posted: Fri Mar 16, 2018 4:32 pm
I'm trying to decide whether I have a memory leak, and would like to be sure I correctly understand the way the default Chibi heap works. As far as I can tell:
1. The value reported by chCoreGetStatus() is 'unassigned' memory which has never been used. It will therefore remain static, or decrease, over time - never increase.
2. The values reported by chHeapStatus() reflect the status of memory which has actually been assigned to the heap; the value 'total' reflecting free space.
Is this correct?
As a matter of interest, has anyone instrumented malloc() and free() to look at this kind of situation?
1. The value reported by chCoreGetStatus() is 'unassigned' memory which has never been used. It will therefore remain static, or decrease, over time - never increase.
2. The values reported by chHeapStatus() reflect the status of memory which has actually been assigned to the heap; the value 'total' reflecting free space.
Is this correct?
As a matter of interest, has anyone instrumented malloc() and free() to look at this kind of situation?