How to check usage of different parts of memory?

10,417

Solution 1

The information is in /proc/zoneinfo, contains very similar information to /proc/vmstat except broken down by "Node" (Numa ID). I don't have a NUMA system here to test it for you and provide a sample output for a multi-node config; it looks like this on a one-node machine:

Node 0, zone      DMA
pages free     2122
      min      16
      low      20
      high     24
      scanned  0
      spanned  4096
      present  3963
[ ... followed by /proc/vmstat-like nr_* values ]
Node 0, zone   Normal
pages free     17899
      min      932
      low      1165
      high     1398
      scanned  0
      spanned  223230
      present  221486
nr_free_pages 17899
nr_inactive_anon 3028
nr_active_anon 0
nr_inactive_file 48744
nr_active_file 118142
nr_unevictable 0
nr_mlock     0
nr_anon_pages 2956
nr_mapped    96
nr_file_pages 166957
[ ... more of those ... ]
Node 0, zone  HighMem
pages free     5177
      min      128
      low      435
      high     743
      scanned  0
      spanned  294547
      present  292245
[ ... ]

I.e. a small statistic on the usage/availability total followed by the nr_* values also found on a system-global level in /proc/vmstat (which then allow a further breakdown as of what exactly the memory is used for).

If you have more than one memory node, aka NUMA, you'll see these zones for all nodes.

edit

I'm not aware of a frontend for this (i.e. a numa vmstat like htop is a numa-top), but please comment if anyone knows one !

Solution 2

The numactl --hardware command will give you a short answer like this:

node 0 cpus: 0 1 2 3 4 5 node 0 size: 49140 MB node 0 free: 25293 MB node 1 cpus: 6 7 8 9 10 11 node 1 size: 49152 MB node 1 free: 20758 MB node distances: node 0 1 0: 10 21 1: 21 10

Share:
10,417
klm123
Author by

klm123

I am physicist. But mostly I do programming. I am interested in C++, parallel and high performance programming.

Updated on June 09, 2022

Comments

  • klm123
    klm123 almost 2 years

    I have computer with 2 Intel Xeon CPUs and 48 GB of RAM. RAM is divided between CPUs - two parts 24 GB + 24 GB. How can I check how much of each specific part is used?

    So, I need something like htop, which shows how fully each core is used (see this example), but rather for memory than for cores. Or something that would specify which part (addresses) of memory are used and which are not.

  • klm123
    klm123 almost 13 years
    FrankH., thanks a lot. And could you help me to find some description of the zoneinfo lines?
  • FrankH.
    FrankH. almost 13 years
  • FrankH.
    FrankH. almost 13 years
    Beyond that, check the Linux kernel sources in mm/vmstat.c for how the data is printed / what is printed there. You'll find that /proc/vmstat has the same contents as /proc/zoneinfo, except summed over all zones.