- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wonder How much is assigned the size of heap memory when a program is built?
and how to check the heap size of the program?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sehee,
You can use the mallinfo( ) function to check the following.
arena: total space allocated from system
ordblks: number of non-inuse chunks
smblks: unused -- always zero
hblks: number of mmapped regions
hblkhd: total space in mmapped regions
usmblks: unused -- always zero
fsmblks: unused -- always zero
uordblks: total allocated space
fordblks: total non-inuse space
keepcost: top-most, releasable (via malloc_trim) space
You can check the usage in command_console_mallinfo.c which is in
<WICED SDK>\libraries\utilities\command_console\mallinfo\command_console_mallinfo.c
Hope this helps.
Thanks,
Jaeyoung
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe there are other threads on this, but did you try: ble_trace1("free memory : %d", cfa_mm_MemFreeBytes());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, the text I provided was for the Bluetooth SDK... I don't know what it is for the WiFi SDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sehee,
You can use the mallinfo( ) function to check the following.
arena: total space allocated from system
ordblks: number of non-inuse chunks
smblks: unused -- always zero
hblks: number of mmapped regions
hblkhd: total space in mmapped regions
usmblks: unused -- always zero
fsmblks: unused -- always zero
uordblks: total allocated space
fordblks: total non-inuse space
keepcost: top-most, releasable (via malloc_trim) space
You can check the usage in command_console_mallinfo.c which is in
<WICED SDK>\libraries\utilities\command_console\mallinfo\command_console_mallinfo.c
Hope this helps.
Thanks,
Jaeyoung