# HG changeset patch # User Sebastien Jodogne # Date 1679740057 -3600 # Node ID 65b05b44ae4c02c677977f61ac44ef6a719af032 # Parent d2626a0628094c2b06915de8019c29d8d43dc54c properly finalizing the housekeeper thread that periodically calls malloc_trim() diff -r d2626a062809 -r 65b05b44ae4c OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Sat Mar 25 11:21:09 2023 +0100 +++ b/OrthancServer/Sources/ServerContext.cpp Sat Mar 25 11:27:37 2023 +0100 @@ -436,7 +436,7 @@ listeners_.push_back(ServerListener(luaListener_, "Lua")); changeThread_ = boost::thread(ChangeThread, this, (unitTesting ? 20 : 100)); #if HAVE_MALLOC_TRIM == 1 - housekeeperThread_ = boost::thread(HousekeeperThread, this, 100); + housekeeperThread_ = boost::thread(HousekeeperThread, this, 1000); #else LOG(INFO) << "Your platform does not support malloc_trim(), not starting the housekeeper thread"; #endif @@ -482,6 +482,11 @@ saveJobsThread_.join(); } + if (housekeeperThread_.joinable()) + { + housekeeperThread_.join(); + } + jobsEngine_.GetRegistry().ResetObserver(); if (isJobsEngineUnserialized_)