Difference between revisions of "Free (command)"
Jump to navigation
Jump to search
↑ https://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <code>free</code> < | + | {{lowercase}} |
− | + | <code>free</code> display amount of free and used [[memory]] in the system. It is included in <code>[[procps]]</code> package. | |
− | free | + | * https://man7.org/linux/man-pages/man1/free.1.html |
+ | |||
+ | free -h | ||
+ | total used free shared [[buff]]/cache available | ||
+ | Mem: 503G 21G 43G 2.1M 438G 478G | ||
+ | Swap: 975M 50M 925M | ||
+ | |||
+ | free | ||
total used free shared buff/cache available | total used free shared buff/cache available | ||
− | Mem: | + | Mem: 528029540 22891532 48868648 2128 456269360 501718128 |
− | Swap: | + | Swap: 999420 51456 947964 |
− | |||
− | + | No [[swap]] configured: | |
− | free | + | free -h |
total used free shared buff/cache available | total used free shared buff/cache available | ||
− | Mem: | + | Mem: 985M 468M 79M 65M 437M 302M |
− | Swap: | + | [[Swap]]: 0B 0B 0B |
− | + | ||
+ | free -g | ||
== Activities == | == Activities == | ||
− | # | + | # Empty the [[buffers cache]]: <code>free -h && [[sync]] && echo 3 > /proc/sys/vm/[[drop_caches]] && free -h</code><ref>https://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system</ref> |
# Use <code>[[fio]]</code> with <code>direct=0</code> to fill up your cache. | # Use <code>[[fio]]</code> with <code>direct=0</code> to fill up your cache. | ||
+ | # Review historical memory usage with: <code>[[sar -r --human]]</code> | ||
+ | # Review <code>[[/proc/meminfo]]</code> | ||
+ | # <code>[[ps]] -eo pid,user,s,comm,size,vsize,rss --sort -size | head</code> | ||
== See also == | == See also == | ||
+ | |||
+ | * [[free (C)]] | ||
+ | * <code>[[sync]]</code> | ||
* <code>[[sar -r]]</code> | * <code>[[sar -r]]</code> | ||
* [[RAM]] and [[file Systems|filesystem]] | * [[RAM]] and [[file Systems|filesystem]] | ||
+ | * {{swap}} | ||
* [[linux-ftools]] | * [[linux-ftools]] | ||
[[Category:Linux]] | [[Category:Linux]] |
Latest revision as of 13:56, 2 November 2021
free
display amount of free and used memory in the system. It is included in procps
package.
free -h total used free shared buff/cache available Mem: 503G 21G 43G 2.1M 438G 478G Swap: 975M 50M 925M
free total used free shared buff/cache available Mem: 528029540 22891532 48868648 2128 456269360 501718128 Swap: 999420 51456 947964
No swap configured:
free -h total used free shared buff/cache available Mem: 985M 468M 79M 65M 437M 302M Swap: 0B 0B 0B
free -g
Activities[edit]
- Empty the buffers cache:
free -h && sync && echo 3 > /proc/sys/vm/drop_caches && free -h
[1] - Use
fio
withdirect=0
to fill up your cache. - Review historical memory usage with:
sar -r --human
- Review
/proc/meminfo
ps -eo pid,user,s,comm,size,vsize,rss --sort -size | head
See also[edit]
- free (C)
sync
sar -r
- RAM and filesystem
- Swap,
swapon
,swapoff
,mkswap
,swaplabel
,free
,sar -r
,sar -S
,sar -W
,vmstat
,vm.swappiness
,/proc/swaps
,/etc/fstab
, Add a swap disk,systemd.swap
- linux-ftools
Advertising: