Child pages
  • Memory cleanup hints
Skip to end of metadata
Go to start of metadata

In-RAM caches

Based on kernel.org doc on sysctl/vm:

# free pagecache:
echo 1 > /proc/sys/vm/drop_caches

# free reclaimable slab objects (includes dentries and inodes):
echo 2 > /proc/sys/vm/drop_caches

# free slab objects and pagecache:
echo 3 > /proc/sys/vm/drop_caches

Swap

ATTENTION: Only if "real" RAM is free, and NOT under load or during high-traffic times.
swapoff -a
swapon -a

Complete cleanup (Desktop version)

To combine all of the above plus king-of-leaks glipper:

killall glipper
 
echo 3 |sudo tee /proc/sys/vm/drop_caches >/dev/null
sudo swapoff -a
sudo swapon -a
echo 3 |sudo tee /proc/sys/vm/drop_caches >/dev/null
 
glipper &
 

Complete cleanup (Server version)

echo 3 > /proc/sys/vm/drop_caches ; swapoff -a ; swapon -a ; echo 3 > /proc/sys/vm/drop_caches
  • No labels