changeset 5149:05112ff6ba22 malloc-trim

trying malloc_trim
author Alain Mazy <am@osimis.io>
date Fri, 27 Jan 2023 16:46:46 +0100
parents 2df546a76e17
children c81f363d3aa3
files OrthancServer/Sources/ServerContext.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.cpp	Fri Jan 27 12:56:55 2023 +0100
+++ b/OrthancServer/Sources/ServerContext.cpp	Fri Jan 27 16:46:46 2023 +0100
@@ -48,7 +48,7 @@
 
 #include <dcmtk/dcmdata/dcfilefo.h>
 #include <dcmtk/dcmnet/dimse.h>
-
+#include <malloc.h>
 
 static size_t DICOM_CACHE_SIZE = 128 * 1024 * 1024;  // 128 MB
 
@@ -143,6 +143,8 @@
           }
         }
       }
+
+      malloc_trim(0);
     }
   }