Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

GETRAMFREE() and IHEAP_GetModuleMemStats()

GETRAMFREE() and IHEAP_GetModuleMemStats() gather the following information on heap usage:

  1. Both IHeap and GETRAMFREE() assume static size heap and only report statistics for the in-process heap. If there are multiple processes in the system, neither IHeap or GETRAMFREE() capture heap information from other processes. Neither do they capture statistics for pageable RAM outside the in-process heap.
  2. GETRAMFREE() accounts for memory occupied and released by the MOD and non-shareable MOD1 that exist in the same process.
  3. The amount of heap in use by a specific module reported by IHEAP_GetModuleMemStats() includes all the in-process objects created from that module (through MALLOC(), REALLOC(), IEnv_CreateInstance(), ISHELL_CreateInstance(), etc.).

    It does not include:

    1. All the service objects created from the module
    2. The size of the module itself
    3. The size of any module that the module uses
    4. The size of MIF and BAR files associated with the module

  4. There is currently no API to report the total available pageable RAM (uncommitted physical memory which is available for use by memory regions).

The figure below shows an example of free and allocated memory, and how memory statistics are collected: