Possible working method to get actual process size on Linux

Per Liden per.liden at oracle.com
Thu Oct 3 13:06:27 UTC 2019


On 10/3/19 2:52 PM, Stefan Reich wrote:
> Breakdown of the process's pages by RSS:
> 
> Address range 000000xxxxxxxxxx: 1 MB
> Address range 000004xxxxxxxxxx: 2461 MB
> Address range 000008xxxxxxxxxx: 2476 MB
> Address range 000010xxxxxxxxxx: 2662 MB
> Address range 00007cxxxxxxxxxx: 648 MB
> 
> This is really getting confusing...

You have three Java heap mappings (~2.5G) + non-Java heap stuff (648M), 
which gives you ~3.1G, which is similar to what ps_mem reports.

/Per

> 
> On Thu, 3 Oct 2019 at 14:47, Stefan Reich 
> <stefan.reich.maker.of.eye at googlemail.com 
> <mailto:stefan.reich.maker.of.eye at googlemail.com>> wrote:
> 
>     The situation is still confusing. My process has:
> 
>     Runtime.totalMemory() = 2.7 GB
>     Runtime.usedMemory() =~ 1 GB
> 
>     ps_mem.py says:
> 
>     root at smartbot:~/bin# ps_mem.py -p 4837
>       Private  +   Shared  =  RAM used Program
> 
>     745.5 MiB +   2.4 GiB =   3.1 GiB java
>     ---------------------------------
>                                3.1 GiB
> 
>     Is the heap counted as shared memory here? The shared memory value
>     seems way too large.
> 
>     My own tool reports < 1 GB as RSS which seems way too low...
> 
> 
>     On Thu, 3 Oct 2019 at 14:32, Per Liden <per.liden at oracle.com
>     <mailto:per.liden at oracle.com>> wrote:
> 
> 
>         On 10/3/19 2:23 PM, Stefan Reich wrote:
>          > Hi Per!
>          >
>          > Yes, I saw, sorry for not responding the other time.
>          >
>          > This problem is, /proc/*/smaps_rollup doesn't exist on one of my
>          > machines (the one with the oldest kernel). On the newer
>         machines, yeah,
>          > it may be an option to use PSS from smaps_rollup.
>          >
>          > Not sure if there are any tools which would help here.
> 
>         I know some of them (e.g. ps_mem.py), works on older kernels that
>         doesn't have /proc/<pid>/smaps_rollup.
> 
>         cheers,
>         Per
> 
>          >
>          > Greetings,
>          > Stefan
>          >
>          > On Thu, 3 Oct 2019 at 14:16, Per Liden <per.liden at oracle.com
>         <mailto:per.liden at oracle.com>
>          > <mailto:per.liden at oracle.com <mailto:per.liden at oracle.com>>>
>         wrote:
>          >
>          >
>          >     Did you see my reply to your previous question on this
>         topic? Tools to
>          >     extract this data (PSS) exist. Are they not doing what
>         you want?
>          >
>          >     cheers,
>          >     Per
>          >
>          >
>          >
>          > --
>          > Stefan Reich
>          > BotCompany.de // Java-based operating systems
> 
> 
> 
>     -- 
>     Stefan Reich
>     BotCompany.de // Java-based operating systems
> 
> 
> 
> -- 
> Stefan Reich
> BotCompany.de // Java-based operating systems


More information about the zgc-dev mailing list