About Linux Memory release
First we may use free to see the memory usage, it should be this:[root@ipython ~]# free-m Total used free shared buffers cached mem: 32040 31707 332 0 498 27649 -/+ buffers/cache: 3559 28480 Swap: 16087 0 16087 # #实际上在一个进程结束后其内存是会被释放的, but the kernel does not immediately collect the memory into free, but is stored in the cache or buffers to improve the system's IO efficiency, cache and buffered memory is the kernel for dynamic configuration management, If the system free size is not enough, the system will automatically release cache buffer memory for the program to use! ### #证: If used occupies a lot, free is very small, and the cache and buffer ratio is also very low, which indicates that memory is not enough to use # #of course, if you still need to see the free more, you can try this:1. Use the Sync command to write all the system buffers that are not written to disk, including the modified I node, the deferred block i\ o, and the read-write mappings [root@ipython ~]# sync 2. Rough Cleaning[root@ipython ~]# cat/proc/sys/vm/drop_caches 0# #可以看到默认是0, Drop_caches offers three options operation # #1 Empty page cache 2 empty inode and directory tree cache 3 empty all caches # #清空缓存页 # #[root@ipython ~]# echo "1" >/proc/sys/vm/drop_caches # #再来看看 # #[root@ipython ~]# free-m Total used free shared buffers cached mem: 32040 2564 29475 0 0 40 -/+ buffers/cache: 2524 29515 Swap: 16087 0 16087
Linux Memory release