# HG changeset patch # User Sebastien Jodogne # Date 1679740717 -3600 # Node ID cddf28cfcd8ddf25d659e531bb85f3c783df6ffe # Parent 65b05b44ae4c02c677977f61ac44ef6a719af032 style diff -r 65b05b44ae4c -r cddf28cfcd8d OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Sat Mar 25 11:27:37 2023 +0100 +++ b/OrthancServer/Sources/ServerContext.cpp Sat Mar 25 11:38:37 2023 +0100 @@ -107,6 +107,8 @@ { } + +#if HAVE_MALLOC_TRIM == 1 void ServerContext::HousekeeperThread(ServerContext* that, unsigned int sleepDelay) { @@ -117,11 +119,11 @@ // If possible, gives memory back to the system // (see OrthancServer/Resources/ImplementationNotes/memory_consumption.txt) -#if HAVE_MALLOC_TRIM == 1 malloc_trim(128*1024); -#endif } } +#endif + void ServerContext::ChangeThread(ServerContext* that, unsigned int sleepDelay) @@ -435,11 +437,13 @@ listeners_.push_back(ServerListener(luaListener_, "Lua")); changeThread_ = boost::thread(ChangeThread, this, (unitTesting ? 20 : 100)); + #if HAVE_MALLOC_TRIM == 1 - housekeeperThread_ = boost::thread(HousekeeperThread, this, 1000); + housekeeperThread_ = boost::thread(HousekeeperThread, this, 100); #else LOG(INFO) << "Your platform does not support malloc_trim(), not starting the housekeeper thread"; #endif + dynamic_cast(*dcmtkTranscoder_).SetLossyQuality(lossyQuality); } catch (OrthancException&) diff -r 65b05b44ae4c -r cddf28cfcd8d OrthancServer/Sources/ServerContext.h --- a/OrthancServer/Sources/ServerContext.h Sat Mar 25 11:27:37 2023 +0100 +++ b/OrthancServer/Sources/ServerContext.h Sat Mar 25 11:38:37 2023 +0100 @@ -187,8 +187,10 @@ static void SaveJobsThread(ServerContext* that, unsigned int sleepDelay); +#if HAVE_MALLOC_TRIM == 1 static void HousekeeperThread(ServerContext* that, unsigned int sleepDelay); +#endif void SaveJobsEngine();