Kernel memory Usage

Discussion in 'Kernel Questions' started by ascetic angel, Sep 12, 2008.

  1. ascetic angel

    ascetic angel New Member

    How to know the % physical memory used by the Linux Kernel and by individual module?
    I'm in a scenario like... say, I want to know the amount of RAM used by IPv6 module. How do I do this? I've tried top, pmap, size, lsmod etc. But couldn't infer much.
    top> wan't much useful to identify the module
    pmap> didn't help either as it needs pid
    size> (usage #size /lib/modules/2.6.25-14.fc9.i686/kernel/net/ipv6/sit.ko) couldn't infer the output
    lsmod also give some size info, but is that RAM usage? does that include code+data+heap?
    free, /proc/meminfo, slabtop none are helpful for me!
    I want the kernel's % of RAM usage (when applications are running) but not the process' % of RAM usage.
    I'm going insane in finding this!

    Thanks in advance!

    # lsmod
    Module Size Used by
    sit 12104 0

    # size /lib/modules/2.6.25-14.fc9.i686/kernel/net/ipv6/sit.ko
    text data bss dec hex filename
    5052 4500 200 9752 2618 /lib/modules/2.6.25-14.fc9.i686/kernel/net/ipv6/sit.ko

    lsmod says it's 12104 bytes, size says 9752 bytes!!!

    # ls /lib/modules/2.6.25-14.fc9.i686/kernel/net/ipv6/sit.ko -l
    -rwxr--r-- 1 root root 14828 2008-05-01 16:19 /lib/modules/2.6.25-14.fc9.i686/kernel/net/ipv6/sit.ko

    as listed by ls, size on disk, of sit.ko module is 14828 bytes...!
    Last edited: Sep 12, 2008

Share This Page