RFR(xs): 8251255: [linux] Add process-memory information to hs-err and VM.info

Doerr, Martin martin.doerr at sap.com
Mon Aug 10 12:24:43 UTC 2020


Hi Thomas,

looks like a really helpful contribution.

Minor nit: You print most values in "kB", but some other ones in "K". I think "kB" should be used consistently.

I don't think kernel < 2.6.34 is still supported. I don't care if you remove the check or not.

Otherwise thumbs up from my side. I don't need to see another webrev.

Best regards,
Martin


> -----Original Message-----
> From: hotspot-runtime-dev <hotspot-runtime-dev-retn at openjdk.java.net>
> On Behalf Of Thomas Stüfe
> Sent: Montag, 10. August 2020 13:52
> To: David Holmes <david.holmes at oracle.com>
> Cc: Hotspot dev runtime <hotspot-runtime-dev at openjdk.java.net>
> Subject: Re: RFR(xs): 8251255: [linux] Add process-memory information to
> hs-err and VM.info
> 
> Thanks for the review, David!
> 
> On Mon, Aug 10, 2020 at 1:42 PM David Holmes <david.holmes at oracle.com>
> wrote:
> 
> > Hi Thomas,
> >
> > This seems fine to me.
> >
> > Thanks,
> > David
> >
> > On 10/08/2020 9:32 pm, Thomas Stüfe wrote:
> > > Hi,
> > >
> > > new version:
> > >
> > >
> > http://cr.openjdk.java.net/~stuefe/webrevs/8251255-add-rss-to-hs-
> err/webrev.01/webrev/
> > >
> > > - changed the type of the receiver variables to ssize_t
> > > - enclosed mallinfo call with __GLIBC__
> > >
> > > Thanks, Thomas
> > >
> > > On Thu, Aug 6, 2020 at 4:01 PM Thomas Stüfe
> <thomas.stuefe at gmail.com
> > > <mailto:thomas.stuefe at gmail.com>> wrote:
> > >
> > >     Hi,
> > >
> > >     may I please have reviews for this addition:
> > >
> > >     JBS: https://bugs.openjdk.java.net/browse/JDK-8251255
> > >     Webrev:
> > >
> > http://cr.openjdk.java.net/~stuefe/webrevs/8251255-add-rss-to-hs-
> err/webrev.00/webrev/
> > >
> > >     When analysing a customer memory leak recently I found for all
> > >     the information we have in the error files we miss some really
> > >     fundamental statistics like process virtual size and rss. Either
> > >     that or I am blind :)
> > >
> > >     In case I am not blind this patch adds those statistics. I decided
> > >     against dumping proc files wholesale to the hs-err file, I
> > >     just print out what I really find useful.
> > >
> > >     Note that among other things I print out the total size of
> > >     outstanding heap allocations. Note that still the best way to do
> > >     this is via mallinfo, and that means the returned value is int and
> > >     may wrap, see coding and comment. Even with this caveat though this
> > >     info is still very useful.
> > >
> > >     I did a number of manual tests, the numbers seem legit.
> > >
> > >     Looks like this:
> > >
> > >     Process Memory:
> > >     Virtual Size: 7494372K (peak: 7559908K)
> > >     Resident Set Size: 271264K (peak: 571348K) (anon: 226460K, file:
> > >     44804K, shmem: 0K)
> > >     Swapped out: 0K
> > >     C-Heap outstanding allocations: 37845K
> > >
> > >
> > >     Here I simulate a C-Heap memory leak:
> > >
> > >     Process Memory:
> > >     Virtual Size: 9062260K (peak: 9118772K)
> > >     Resident Set Size: 1941776K (peak: 1941776K) (anon: 1896872K, file:
> > >     44904K, shmem: 0K)
> > >     Swapped out: 0K
> > >     C-Heap outstanding allocations: 1291984K
> > >
> > >
> > >     Same leak, with the mallinfo value wrapped around:
> > >
> > >     Process Memory:
> > >     Virtual Size: 12343352K (peak: 12445556K)
> > >     Resident Set Size: 5232084K (peak: 5281512K) (anon: 5187052K, file:
> > >     45032K, shmem: 0K)
> > >     Swapped out: 0K
> > >     C-Heap outstanding allocations: 15454K (may have wrapped)
> > >
> > >     Thanks, Thomas
> > >
> >


More information about the hotspot-runtime-dev mailing list