Increasing the Priority of a Third-Party Application

This section describes how a third-party application can increase its OOM priority by using OOM Monitor APIs.

Third-party applications that needs to be running all the time can increase their priority to High from the default level ( Normal ). By increasing the priority, applications can protect itself from being closed by the OOM Monitor. For example:

  • IP Phone application receiving IP calls

  • Instant Messaging application receiving messages

are applications which listens for events from the network all the time.

  1. Create an OOM Monitor session
            ROomMonitorSession ioomMonitorSession;
    CleanUpClosePushL(ioomMonitorSession);
    User::LeaveIfError(ioomMonitorSession.Connect());
           
  2. Set the priority for the application to High .
            iOomMonitorSession.SetOomPriority(ROomMonitorSession::EOomPriorityHigh);
    DoCriticalBackgroundProcessingL();
           
  3. Close the session.
            iOomMonitorSession.Close();