uiacceltk/hitchcock/goommonitor/src/goommemorymonitor.cpp
branchRCL_3
changeset 54 78e19bc09b73
parent 52 31fccae4f8a7
child 63 e1987ab3768a
equal deleted inserted replaced
52:31fccae4f8a7 54:78e19bc09b73
   203 void CMemoryMonitor::FreeMemThresholdCrossedL(TInt /*aAction*/, TInt aThreshold)
   203 void CMemoryMonitor::FreeMemThresholdCrossedL(TInt /*aAction*/, TInt aThreshold)
   204     {
   204     {
   205     FUNC_LOG;
   205     FUNC_LOG;
   206     // keep only one notification active at a moment
   206     // keep only one notification active at a moment
   207 #ifdef USE_ASYNCYH_NOTIFICATIONS 
   207 #ifdef USE_ASYNCYH_NOTIFICATIONS 
   208     TInt current = GetFreeMemory();
   208    
   209     if (aThreshold == EGL_PROF_TOTAL_MEMORY_USAGE_LT_NOK)
   209     if (aThreshold == EGL_PROF_TOTAL_MEMORY_USAGE_LT_NOK)
   210         {
   210         {
       
   211         TInt current = GetFreeMemory();
   211         if(current >= iGoodThreshold  && (!NeedToPostponeMemGood()))
   212         if(current >= iGoodThreshold  && (!NeedToPostponeMemGood()))
   212             {
   213             {
   213             TRACES2("FreeMemThresholdCrossedL : crossed good threshold Free %d, GThresh %d, Calling MemoryGood",current, iGoodThreshold);
   214             TRACES2("FreeMemThresholdCrossedL : crossed good threshold Free %d, GThresh %d, Calling MemoryGood",current, iGoodThreshold);
   214             iGOomActionList->MemoryGood();
   215             iGOomActionList->MemoryGood();
   215             iMemAllocationsGrowing->Continue();
   216             iMemAllocationsGrowing->Continue();
   227                 iMemAllocationsGoingDown->Continue();
   228                 iMemAllocationsGoingDown->Continue();
   228             }
   229             }
   229         }
   230         }
   230     else//if aThreshold == EGL_PROF_TOTAL_MEMORY_USAGE_GT_NOK
   231     else//if aThreshold == EGL_PROF_TOTAL_MEMORY_USAGE_GT_NOK
   231         {
   232         {
   232         if(current < iLowThreshold)
   233         TRACES1("FreeMemThresholdCrossedL : crossed low threshold %d", iLowThreshold);
   233             {
   234         iMemAllocationsGrowing->Stop();
   234             TRACES1("FreeMemThresholdCrossedL : crossed low threshold %d", iLowThreshold);
   235         iMemAllocationsGoingDown->Continue();
   235             iMemAllocationsGrowing->Stop();
   236         if((iTrigger == EGOomTriggerNone) && !NeedToPostponeMemGood())
   236             iMemAllocationsGoingDown->Continue();
   237             {
   237             if((iTrigger == EGOomTriggerNone) && !NeedToPostponeMemGood())
   238             if(iSynchTimer->IsActive())
   238                 {
   239                 iSynchTimer->Cancel();
   239                 if(iSynchTimer->IsActive())
   240             StartFreeSomeRamL(iGoodThreshold, EGOomTriggerThresholdCrossed);
   240                     iSynchTimer->Cancel();
   241             }
   241                 StartFreeSomeRamL(iGoodThreshold, EGOomTriggerThresholdCrossed);
       
   242                 }
       
   243             }
       
   244         else
       
   245             TRACES2("FreeMemThresholdCrossedL : crossed low threshold %d, FALSE ALARM, FreeMem = %d", iLowThreshold, current);
       
   246         }
   242         }
   247 #endif
   243 #endif
   248     }
   244     }
   249 
   245 
   250 void CMemoryMonitor::HandleFocusedWgChangeL(TInt aForegroundAppUid)
   246 void CMemoryMonitor::HandleFocusedWgChangeL(TInt aForegroundAppUid)