RFR: JDK-8286198: [linux] Fix process-memory information

David Holmes dholmes at openjdk.java.net
Mon May 9 02:55:58 UTC 2022


On Thu, 5 May 2022 14:55:01 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> We use mallinfo/mallinfo2 to obtain information about the glibc used memory, but there is an error which causes it to be correct only for fine granular malloc allocations. glibc puts larger allocations in mmap-allocated areas, which were missing from the old calculation.
> 
> This patch fixes that; it also adds information about memory retained in the glibc after free. Note that the latter unfortunately does not follow glibc trims because trimming is done AFAIK with madvice(MADV_DONTNEED) which does not seem to affect glibc internal bookkeeping. Still its a very valuable thing to know in order to estimate glibc overhead especially in fine granular mass allocation scenarios.
> 
> Tests: Lots of manual tests with various malloc loads and granularities, in addition to automated tests.

I don't understand your "free retained" terminology, but otherwise the changes seem fine and do what you describe.

Thanks,
David

-------------

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8553


More information about the hotspot-runtime-dev mailing list