97 private: |
97 private: |
98 CMemoryMonitor* iMemoryMonitor; |
98 CMemoryMonitor* iMemoryMonitor; |
99 }; |
99 }; |
100 |
100 |
101 |
101 |
|
102 class COomMonitorPluginV2 : public COomMonitorPlugin |
|
103 { |
|
104 public: // From COomMonitorPlugin |
|
105 /** |
|
106 * FreeRam is called when the system RAM level becomes |
|
107 * low. This plugin is requested to help free some RAM. |
|
108 * |
|
109 * Note that OomMonitorV2 will not call this version of the function so it does not need to be implemented. |
|
110 */ |
|
111 IMPORT_C virtual void FreeRam(); |
|
112 |
|
113 /** |
|
114 * MemoryGood is called when the system RAM level becomes |
|
115 * good after being low.The plugin may take this opportunity |
|
116 * to start using RAM again. |
|
117 * Nb It is assumed that the plugin will not immediately |
|
118 * cause a large increase in memory use, but that memory may be |
|
119 * used over time, otherwise the plugin may cause oscillation |
|
120 * between low and good memory states. |
|
121 */ |
|
122 virtual void MemoryGood() = 0; |
|
123 |
|
124 public: |
|
125 /** |
|
126 * FreeRam is called when the system RAM level becomes |
|
127 * low. This plugin is requested to help free some RAM. |
|
128 * Note that it is desirable to delete all memory associated with this plugin if |
|
129 * not using a disconnected chunk. The reason for this is that by only releasing a small amount |
|
130 * of the memory you reduce the chances of that memory being at the end of the chunk and therefore |
|
131 * reduce the likelihood of it being released to the system. |
|
132 * @param aBytesToFree The minimum number of bytes of free memory that the plugin should try to free. |
|
133 */ |
|
134 virtual void FreeRam(TInt aBytesToFree) = 0; |
|
135 |
|
136 }; |
|
137 |
|
138 |
|
139 |
102 /** |
140 /** |
103 * CAppOomMonitorPlugin is a specialised OOM monitor plugin |
141 * CAppOomMonitorPlugin is a specialised OOM monitor plugin |
104 * that sends messages to applications when the memory state |
142 * that sends messages to applications when the memory state |
105 * changes. |
143 * changes. |
106 * The target application is specified by the appUid parameter. |
144 * The target application is specified by the appUid parameter. |