diff --git a/src/internfile/mh_xslt.cpp b/src/internfile/mh_xslt.cpp index c319731d..867a5ac9 100644 --- a/src/internfile/mh_xslt.cpp +++ b/src/internfile/mh_xslt.cpp @@ -16,6 +16,8 @@ */ #include "autoconfig.h" +#include + #include #include #include @@ -45,6 +47,12 @@ public: virtual ~FileScanXML() { if (ctxt) { xmlFreeParserCtxt(ctxt); + // This should not be necessary (done by free), but see + // http://xmlsoft.org/xmlmem.html#Compacting The + // malloc_trim() and mallopt() doc seems to be a bit + // misleading, there is probably a frag size under which + // free() does not try to malloc_trim() at all + malloc_trim(0); } }