显示程序使用最大内存函数

 
#ifdef AEE_SIMULATOR ////modify by lancer at 2007-03-15
void Eragon::useCheckMemory( )
{
       IShell* pIShell=((AEEApplet*)GETAPPINSTANCE())->m_pIShell;
       IHeap* pIHeap;
       uint32 num;
       AEEDeviceInfo di;
       pIHeap = NULL;
 
//     uint32 un32Max = 0;
 
       if (SUCCESS != ISHELL_CreateInstance(pIShell,       AEECLSID_HEAP, (void**)&pIHeap))
       {
              return;
       }
 
       ISHELL_GetDeviceInfo(pIShell, &di);
       num = IHEAP_GetMemStats(pIHeap);
       if (num>maxMemory || num>MAX_NEED_HEAP1_SIZE){
              if (num>MAX_NEED_HEAP1_SIZE)
              {
                     DBGPRINTF("--------------------------out of memory-------------------!");
              }
DBGPRINTF("total RAM :%d", di.dwRAM);
DBGPRINTF("Now used RAM is:%d", num);
DBGPRINTF("free RAM:%d", di.dwRAM - num);
maxMemory = num;
       }
 
       IHEAP_Release(pIHeap);
       return;
}
#endif 
原文地址:https://www.cnblogs.com/secbook/p/2655477.html