How to get the stack and heap size for a specific process in linux - Linux

This is a discussion on How to get the stack and heap size for a specific process in linux - Linux ; How to get the stack and heap size for a specific process in linux? Please check whether this is true: The individual sizes are in /proc/ /smaps, to find out the total, I should write a script to sum the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to get the stack and heap size for a specific process in linux

  1. How to get the stack and heap size for a specific process in linux

    How to get the stack and heap size for a specific process in linux?

    Please check whether this is true:
    The individual sizes are in /proc//smaps, to find out the total,
    I should write a script to sum the sizes in smaps or the /proc//
    stat file have the total.

    # cat smaps
    00110000-00185000 r-xp 00000000 03:03 15539365 /usr/lib/
    librpmio-4.4.so
    Size: 468 kB
    Rss: 264 kB
    Shared_Clean: 0 kB
    Shared_Dirty: 0 kB
    Private_Clean: 264 kB
    Private_Dirty: 0 kB
    00185000-00188000 rwxp 00074000 03:03 15539365 /usr/lib/
    librpmio-4.4.so
    Size: 12 kB
    Rss: 12 kB
    Shared_Clean: 0 kB
    Shared_Dirty: 0 kB
    Private_Clean: 0 kB
    Private_Dirty: 12 kB
    ....

    # cat stat
    16030 (snmpd) S 1 16029 16029 0 -1 4202816 13480 0 0 0 4 1 0 0 15 0 1
    0 132108223 16416768 1033 4294967295 134512640 134539016 3213942720
    3213941772 6493186 0 0 4096 16794115 0 0 0 17 1 0 0 0

  2. Re: How to get the stack and heap size for a specific process inlinux

    On Jan 4, 11:06 am, wong_po...@yahoo.ca wrote:
    > How to get the stack and heap size for a specific process in linux?
    >
    > Please check whether this is true:
    > The individual sizes are in /proc//smaps, to find out the total,
    > I should write a script to sum the sizes in smaps or the /proc//
    > stat file have the total.
    >
    > # cat smaps
    > 00110000-00185000 r-xp 00000000 03:03 15539365 /usr/lib/
    > librpmio-4.4.so
    > Size: 468 kB
    > Rss: 264 kB
    > Shared_Clean: 0 kB
    > Shared_Dirty: 0 kB
    > Private_Clean: 264 kB
    > Private_Dirty: 0 kB
    > 00185000-00188000 rwxp 00074000 03:03 15539365 /usr/lib/
    > librpmio-4.4.so
    > Size: 12 kB
    > Rss: 12 kB
    > Shared_Clean: 0 kB
    > Shared_Dirty: 0 kB
    > Private_Clean: 0 kB
    > Private_Dirty: 12 kB
    > ...
    >
    > # cat stat
    > 16030 (snmpd) S 1 16029 16029 0 -1 4202816 13480 0 0 0 4 1 0 0 15 0 1
    > 0 132108223 16416768 1033 4294967295 134512640 134539016 3213942720
    > 3213941772 6493186 0 0 4096 16794115 0 0 0 17 1 0 0 0



    In particular, for the java application, is there a better way to get
    the info?

+ Reply to Thread