22 #ifndef MEMORYMONITOR_H
23 #define MEMORYMONITOR_H
34 #if defined(HAS_MEMCHUTE)
63 bool getMemInfo(
int& lowMemoryEntryRem,
int& criticalMemoryEntryRem,
int& rebootMemoryEntryRem);
75 int getCurrentRssUsage()
const;
77 int getProcessMemInfo(pid_t pid);
79 void adjustOomScore();
81 #if defined(HAS_MEMCHUTE)
82 static void memchuteCallback(MemchuteThreshold threshold);
83 void memchuteStateChanged();
84 int getMonitoredProcessesMemoryOffset();
85 void checkMonitoredProcesses();
90 Timer<MemoryMonitor> m_timer;
93 static const int kFileNameLen = 128;
94 char m_fileName[kFileNameLen];
98 #if defined(HAS_MEMCHUTE)
99 MemchuteWatcher* m_memWatch;
108 typedef std::map<pid_t, ProcMemMonitor*> ProcMemRestrictions;
110 ProcMemRestrictions memRestrict;