From f15e5eeb39e0a6edf9220f9c0fce0c54dff76f8b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 23 Jul 2014 13:15:55 +0400 Subject: [PATCH] lib/xmltree/xmlinterface.cpp: use posix_fadvise to try reduce cached pages, while loading huge epg data --- lib/xmltree/xmlinterface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/xmltree/xmlinterface.cpp b/lib/xmltree/xmlinterface.cpp index a1699d612..e8d9792bc 100644 --- a/lib/xmltree/xmlinterface.cpp +++ b/lib/xmltree/xmlinterface.cpp @@ -42,7 +42,8 @@ #else /* USE_LIBXML */ #include "xmltok.h" #endif /* USE_LIBXML */ - +#include +#include unsigned long xmlGetNumericAttribute(const xmlNodePtr node, const char *name, const int base) { @@ -239,6 +240,9 @@ xmlDocPtr parseXmlFile(const char * filename, bool warning_by_nonexistence /* = } while (!done); + if (posix_fadvise(fileno(xml_file), 0, 0, POSIX_FADV_DONTNEED) != 0) + perror("posix_fadvise FAILED!"); + fclose(xml_file); if (!tree_parser->RootNode())