Sometimes I found that my program’s performance got really bad after a long series of benchmarks. The reason is the amoutn of “free memory” is low. Why is this happening? Here are some notes exploring this problem, and ways you can clean up your memory.
Of all the posts I found, this is the best explaining why we have free memory.
A great discussion post from Stackoverflow
The problem is that you have page caches, and slab objects around in memory (serving as disk cache). This can be potentially a problem for high performance applications.
Here is a way to check if you have the problem and deal with it.
(One approach to free up memory first suggested by Vladimir Kiriansky, my office mate).
first check after a job that you’re indeed NUMA imbalanced:
numactl -H | grep free
and add this function to a file.
echo Dropping PageCache and SLAB objects,
# first give priority to handling dirty data, so we can free it all
echo 3 | sudo tee /proc/sys/vm/drop_caches
or you can
and you can call the function from other scripts (or your shell)
Documentation on drop_cache
This entry was posted in Uncategorized
. Bookmark the permalink