I'm trying to figure if my software running on linux suffers from memory leak
. I've tried to measure the available physical memory as found in /proc/meminfo
(see below) but could understand which field(s) represents the available memory and what is the relation between MemFree, Cached, Buffers, Active, Inactive
.
cat /proc/meminfo
MemTotal: 124128 kB
MemFree: 62872 kB
Buffers: 0 kB
Cached: 15624 kB
SwapCached: 0 kB
Active: 38724 kB
Inactive: 11148 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 34272 kB
Mapped: 14640 kB
Slab: 5564 kB
SReclaimable: 424 kB
SUnreclaim: 5140 kB
PageTables: 504 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 62064 kB
Committed_AS: 57936 kB
VmallocTotal: 655360 kB
VmallocUsed: 1016 kB
VmallocChunk: 654328 kB
Press Ctrl + Shift + Esc to launch Task Manager. Or, right-click the Taskbar and select Task Manager. Select the Performance tab to see current RAM usage displayed in the Memory box, and total RAM capacity listed under Physical Memory.
available memory in Linux is, that free memory is not in use and sits there doing nothing. While available memory is used memory that includes but is not limited to caches and buffers, that can be freed without the performance penalty of using swap space.
Right-click on Start menu button and then click on Task Manager . Click on Performance tab and then on Memory option. The Memory option shows details such as Total memory, used memory and available memory. This option also shows two graphs related to the Memory in the server.
This is simpler command to check memory usage:
free
/proc/meminfo is for overall system memory information. /proc/[pid]/status has the memory usage info for an individual process. (it's also in /proc/[pid]/stat in a more machine parseable format).
In particular, VmData (size of data segment) and VmStk (size of stack segments) are most likely of use to you. Or just use ps
or top
instead of trying to read the data directly yourself.
The other numbers are likely to just be confusing, because the overall system memory usage is complicated by shared memory, various kinds of buffers, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With