Reclaim 'buffer' and 'cache' in Linux System

Clean buffer and cache manually

# rsync
# echo 3 > /proc/sys/vm/drop_caches

Note:

  1. Any files under tmpfs partition is not reclaimable until they're deleted;
  2. Shared memory claimed by 'shmget' method is not reclaimable until they're deleted by 'ipcrm';

Check shared RAM (or IPC) size

# ipcs -m
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status  
0x00000000 6782976    mysql      644        561078272  30  
0x00000000 6815745    prog1      644        27148288   27  

Reference:
Linux内存中的Cache真的能被回收么