3 Replies Latest reply on Dec 21, 2015 5:14 PM by JaeyoungY_71

    How to check the heap size of a program?

    seki_2184131

      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?

        • 1. Re: How to check the heap size of a program?
          ShawnA_01

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

          • 2. Re: How to check the heap size of a program?
            ShawnA_01

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

            • 3. Re: How to check the heap size of a program?
              JaeyoungY_71

              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