From 15158d9273d2482abea4656dcfda8ce7f486a9c9 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 8 Jul 2016 09:01:12 +0200 Subject: When using big indexes it seems like the memory used by the oldindex that was mapped in are still lying around in the buffercache. These is troublsome for linux memory management. So we tell them explicit that we do not need it anymore. We already do that in FileUtil::LoadedMmap::~LoadedMmap() { madvise(_mapBuffer, _mapSize, MADV_DONTNEED); munmap(_mapBuffer, _mapSize); } --- fastos/src/vespa/fastos/unix_file.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'fastos') diff --git a/fastos/src/vespa/fastos/unix_file.cpp b/fastos/src/vespa/fastos/unix_file.cpp index bf8f337fdab..43cf14cafd9 100644 --- a/fastos/src/vespa/fastos/unix_file.cpp +++ b/fastos/src/vespa/fastos/unix_file.cpp @@ -255,6 +255,7 @@ FastOS_UNIX_File::Close(void) } if (_mmapbase != NULL) { + madvise(_mmapbase, _mmaplen, MADV_DONTNEED) munmap(static_cast(_mmapbase), _mmaplen); _mmapbase = NULL; _mmaplen = 0; -- cgit v1.2.3