RSS Feed

Tags

Archives

Categories

Recent Posts

Links

Calculating linux kernel memory usage (waste)

March 4th, 2011 by D in Linux, Tech

These are some nice commands to find how much memory your linux kernel uses.

Indeed those are for 2.6 kernels.

You can look at the 2 attached PDF for more information about this.

  • Finding memory (in used by the firmwares
    dmesg | grep usable | aws ‘{ n += strtonum(“0x” $4) – strtonum(“0x” $2) }

    END { print n/(1024*1024) }’

  • How much memory is left after the kernel is in memory (bootmem)
    dmesg | grep Memory
  • Total memory used by the page allocator (need magick sysreq keys) this will show memory used by the kernel and memory used by the user space, but nothing before bootmem or BIOS.
    sysrq-m
  • Memory used for slabs
    cat /proc/slabinfo
    or
    slabtop

linux memory, linux memorywaste