Skip memory cleanup when memproportion is not configured

Change-Id: I3799d914b5155c37f37bb497ac48e76c1a68761b
This commit is contained in:
Pranav Kant 2017-07-10 20:41:49 +05:30
parent b1194dfa3c
commit aa6b96aaed
2 changed files with 7 additions and 2 deletions

View file

@ -536,8 +536,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 )
{

View file

@ -624,7 +624,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" },