summaryrefslogtreecommitdiffstats
path: root/wsd/Admin.hpp
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-07 17:12:19 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-07-07 21:14:53 +0530
commitfde57adbbf9ab2fba80c6b8e0d877c797b55bea5 (patch)
treea96aa46333227e8dda9c0c06cc17150c4f509a51 /wsd/Admin.hpp
parentLets do away with this (diff)
downloadonline-fde57adbbf9ab2fba80c6b8e0d877c797b55bea5.tar.gz
online-fde57adbbf9ab2fba80c6b8e0d877c797b55bea5.zip
Introduce hard mode when we are OOM
Start killing documents when memory usage goes above threshold. Also make it possible to close documents from admin instance. In DocumentBroker::closeDocument, just set the _stop flag and wake up the polling thread which will terminate the children, instead of manually terminating the children. Change-Id: Ie70e05b3fb6ea816a87b6dcfaed92cdddb94aa90
Diffstat (limited to 'wsd/Admin.hpp')
-rw-r--r--wsd/Admin.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/wsd/Admin.hpp b/wsd/Admin.hpp
index d5b62cb8d7..54b9a8e76b 100644
--- a/wsd/Admin.hpp
+++ b/wsd/Admin.hpp
@@ -118,6 +118,10 @@ private:
/// Notify Forkit of changed settings.
void notifyForkit();
+ /// Memory consumption has increased, start killing kits etc. till memory consumption gets back
+ /// under @hardModeLimit
+ void triggerMemoryCleanup(size_t hardModeLimit);
+
private:
/// The model is accessed only during startup & in
/// the Admin Poll thread.
@@ -128,6 +132,7 @@ private:
size_t _lastJiffies;
uint64_t _lastSentCount;
uint64_t _lastRecvCount;
+ size_t _totalSysMem;
std::atomic<int> _memStatsTaskIntervalMs;
std::atomic<int> _cpuStatsTaskIntervalMs;