Possible working method to get actual process size on Linux
stefan.reich.maker.of.eye at googlemail.com
Thu Oct 3 10:30:06 UTC 2019
Cleaned up address ranges:
Address range 000000xxxxxxxxxx: 6 MB
Address range 000004xxxxxxxxxx: 701 MB
Address range 000008xxxxxxxxxx: 691 MB
Address range 000010xxxxxxxxxx: 744 MB
Address range 00007cxxxxxxxxxx: 720 MB
So the final question is which 3 values of the 4 to discard - they're all
slightly different as you can see...
On Thu, 3 Oct 2019 at 12:21, Stefan Reich <
stefan.reich.maker.of.eye at googlemail.com> wrote:
> Addendum - ok, quite obviously the ranges are 000004-000007 etc. (see
> those suspicious repeating 38 MB value).
> So the only question remains if ZGC always uses these ranges. (What if the
> heap gets bigger than that?)
> On Thu, 3 Oct 2019 at 12:19, Stefan Reich <
> stefan.reich.maker.of.eye at googlemail.com> wrote:
>> I'm still trying to get Linux to report a correct process size when using
>> ZGC (the memory multi-mapping issue).
>> My idea is to parse /proc/pid/smaps. Sadly, I can't see physical
>> addresses there, only virtual ones. So I group by virtual address range.
>> Here's what I got for an example process with is reported by top as 2.7 GB:
>> Address range 000000xxxxxxxxxx: 6 MB
>> Address range 000004xxxxxxxxxx: 38 MB
>> Address range 000007xxxxxxxxxx: 646 MB
>> Address range 000008xxxxxxxxxx: 38 MB
>> Address range 00000bxxxxxxxxxx: 631 MB
>> Address range 000010xxxxxxxxxx: 38 MB
>> Address range 000013xxxxxxxxxx: 690 MB
>> Address range 00007fxxxxxxxxxx: 726 MB
>> It appears I have to discount the 07, 0b and 13 ranges to get to a
>> reasonable actual process size of 844 MB.
>> Question: Are these address ranges fixed or does ZGC choose
>> different ones depending on heap size? Where exactly do the address ranges
>> begin and end?
>> As soon as this reporting method works, let's publish it as a standard
>> tool for anyone using ZGC on Linux. I can't be the only one who's driven
>> nuts by not knowing how big my processes are.
>> Stefan Reich
>> BotCompany.de // Java-based operating systems
> Stefan Reich
> BotCompany.de // Java-based operating systems
BotCompany.de // Java-based operating systems
More information about the zgc-dev