Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

SeKi_2184131
New Contributor

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?

0 Likes
1 Solution
JaeyoungY_71
Employee

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

View solution in original post

0 Likes
3 Replies
ShawnA_01
Employee

I believe there are other threads on this, but did you try:  ble_trace1("free memory : %d", cfa_mm_MemFreeBytes());

0 Likes
ShawnA_01
Employee

Sorry, the text I provided was for the Bluetooth SDK... I don't know what it is for the WiFi SDK.

0 Likes
JaeyoungY_71
Employee

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

View solution in original post

0 Likes