Free up memory in Linux
By Aravind
- Create a file freemem.sh
- Add permissions.
chmod +x freemem.sh
- execute as ./freemem.sh
root@ubuntu:~# more freemem.sh
sync; echo 1 > /proc/sys/vm/drop_caches
sync; echo 2 > /proc/sys/vm/drop_caches
sync; echo 3 > /proc/sys/vm/drop_caches
Display memory
root@compute21:~# free -h
total used free shared buff/cache available
Mem: 251G 80G 30G 8.1M 139G 168G
Swap: 255G 67M 255G
linux
]
tags: linux