API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IHEAP_GETMODULEMEMSTATS()

Brew Release
Brew MP 1.0.2
See Also
Description
This function reports statistics on memory (RAM) used by each module. It reports two pieces of information:

1) The heap space (in bytes) currently being used by this module.

2) Maximum heap space (in bytes) used by this module up to this point.

The class ID (in the cls parameter) denotes the applet for which the heap statistics are required. This function returns the heap statistics for the module to which this applet belongs.
If there are two applets that belong to the same module (have the same .mif), this function returns combined statistics for the entire module and not for the individual applets.
If a class ID 0 is given, the statistics are returned for the system. For system context, information about the maximum heap used is not provided and is set to 0; only heap space that is currently used is provided.
If the class ID passed to the function is not the same as that of the calling applet, the calling app needs to have a group privilege level of AEEGROUPID_MEMORY_STATS. Any applet wanting to get the system-level memory statistics needs to have the AEEGROUPID_MEMORY_STATS privilege level.
Params
pIHeap
[]:
[in] Pointer to the IHeap Interface object.
cls
[]:
[in] class ID for whose module the memory stats are requested.
pMaxHeap
[]:
[out] uint32 pointer in which the maximum amount of heap used by the module is returned. The unit is bytes. For system-level memory statistics this value is not provided and is set to 0.
pCurHeapUsed
[]:
[out] A uint32 pointer in which the current amount of heap space used by the module is returned. The unit is bytes.
Interface
  • IHEAP
Prototype
  • int IHEAP_GetModuleMemStats(IHeap *pIHeap, AEECLSID cls, uint32 *pMaxHeap, uint32 *pCurHeapUsed);
    
Return
  • AEE_SUCCESS: Able to find the memory stats for the given class id. AEE_ENOSUCH: Failed to find the applet for the given class ID. AEE_EPRIVLEVEL: The calling app does not have the group privilege for getting memory stats for class ID specified. AEE_EBADPARM: Either pMaxHeap is a NULL pointer when the class ID is not 0, or pCurHeapUsed is NULL when the class ID is 0.
Side Effect
  • None
Comments
None.