Linux memory: Difference between revisions
From DWIKI
m (→Links) |
m (→Documentation) |
||
Line 50: | Line 50: | ||
It includes all memory that the process can access, including memory that is swapped out, memory that is allocated, but not used, and memory that is from shared libraries. | It includes all memory that the process can access, including memory that is swapped out, memory that is allocated, but not used, and memory that is from shared libraries. | ||
*[https://www.baeldung.com/linux/resident-set-vs-virtual-memory-size RSS vs VmSize] | *[https://www.baeldung.com/linux/resident-set-vs-virtual-memory-size RSS vs VmSize] | ||
==ZFS and arc== | |||
*[https://superuser.com/questions/1137416/how-can-i-determine-the-current-size-of-the-arc-in-zfs-and-how-does-the-arc-rel Determine arc usage] | |||
= FAQ = | = FAQ = |
Revision as of 10:20, 22 May 2023
Links
- Linux ate my RAM!
- Understanding /proc/meminfo
- How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
- How to interpret output from Linux 'top' command?
- Understanding VM swappiness
- What is swappiness on Linux
- https://www.kernel.org/doc/html/latest/filesystems/proc.html The /proc Filesystem]
- Swappiness in Linux: Everything you need to know
- https://serverfault.com/questions/85470/meaning-of-the-buffers-cache-line-in-the-output-of-free
- Memory Consumption in Linux
- Difference between Paging and Swapping
- Why is system using swap when there is enough free space in ram?
- Linux page cache basics
Documentation
man 5 proc
see /proc/meminfo
total
Is MemTotal in /proc/meminfo
Total usable ram (i.e. physical ram minus a few reserved bits and the kernel binary code)
used
total - free - buffers - cache
unused
MemFree
RSS
Resident Set Size
RSS and VSZ in Linux memory management
"memory is allocated to that process and is in RAM. It does not include memory that is swapped out. It does include memory from shared libraries as long as the pages from those libraries are actually in memory. It does include all stack and heap memory."
VSZ / VmSize
Virtual Memory Size It includes all memory that the process can access, including memory that is swapped out, memory that is allocated, but not used, and memory that is from shared libraries.
ZFS and arc
FAQ
What is using all my memory?
smem -r -s swap| head -n3
What is using all my swap?
https://www.cyberciti.biz/faq/linux-which-process-is-using-swap/
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less
or to just list top 3
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | head -n 3
Clear buffer/cache
sync; echo 3 > /proc/sys/vm/drop_caches