diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-07-08 09:01:12 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-07-08 09:01:12 +0200 |
commit | 15158d9273d2482abea4656dcfda8ce7f486a9c9 (patch) | |
tree | 945c2ce39f033f84ff930adad21b15dcdd76cedc /fastos | |
parent | 593c11dea54604e775e645b2bbfb08d22f08742c (diff) |
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);
}
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/vespa/fastos/unix_file.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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<char *>(_mmapbase), _mmaplen); _mmapbase = NULL; _mmaplen = 0; |