[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/Admin.cpp wsd/LOOLWSD.cpp

Pranav Kant pranavk at collabora.co.uk
Mon Jul 31 19:35:03 UTC 2017


 wsd/Admin.cpp   |    8 +++++++-
 wsd/LOOLWSD.cpp |    1 -
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit a5b3e4a861ec6cd54aa94fb2f00f4573f647d9da
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Mon Jul 10 20:41:49 2017 +0530

    Skip memory cleanup when memproportion is not configured
    
    Change-Id: I3799d914b5155c37f37bb497ac48e76c1a68761b
    (cherry picked from commit aa6b96aaed1d9636881e1b8251ba1124dab114b5)

diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 0e78f9e9..ef2fecec 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -434,8 +434,14 @@ void Admin::triggerMemoryCleanup(size_t totalMem)
 {
     LOG_TRC("Total memory we are consuming (in kB): " << totalMem);
     // Trigger mem cleanup when we are consuming too much memory (as configured by sysadmin)
-    const auto memLimit = LOOLWSD::getConfigValue<double>("memproportion", static_cast<double>(80.0));
+    const auto memLimit = LOOLWSD::getConfigValue<double>("memproportion", static_cast<double>(0.0));
     LOG_TRC("Mem proportion for LOOL configured : " << memLimit);
+    if (memLimit == 0.0 || _totalSysMem == 0)
+    {
+        LOG_TRC("Not configured to do memory cleanup. Skipping memory cleanup.");
+        return;
+    }
+
     float memToFreePercentage = 0;
     if ( (memToFreePercentage = (totalMem/static_cast<double>(_totalSysMem)) - memLimit/100.) > 0.0 )
     {
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 6307acb5..7174c864 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -617,7 +617,6 @@ void LOOLWSD::initialize(Application& self)
             { "lo_jail_subpath", "lo" },
             { "server_name", "" },
             { "file_server_root_path", "loleaflet/.." },
-            { "memproportion", "80.0" },
             { "num_prespawn_children", "1" },
             { "per_document.max_concurrency", "4" },
             { "per_document.idle_timeout_secs", "3600" },


More information about the Libreoffice-commits mailing list