[PATCH] RFR Bug-pending: Enable Hotspot to Track Native Memory Usage for Direct Byte Buffers

Adam Farley8 adam.farley at uk.ibm.com
Tue Feb 27 11:53:18 UTC 2018

Hi Alan, Peter,

The main bit of data I wanted out of this was the sum total of native 
being used to store DirectByteBuffers, and to have that information 
in diagnostic cores.

Thanks for pointing out Bits. I will investigate if there is a way to make 
data available to the VM when a diagnostic core is generated (I'm poking
through SharedSecrets and JavaNioAccess now) without running java code.

Worst case scenario, we don't get this feature, and at least we can
retrieve this information from the core by using, as Alan suggests, an SA-
based tool to retrieve the state of the Bits variables at crash-time.

Best Regards

Adam Farley

From:   Alan Bateman <Alan.Bateman at oracle.com>
To:     Peter Levart <peter.levart at gmail.com>, Adam Farley8 
<adam.farley at uk.ibm.com>
Cc:     "hotspot-dev at openjdk.java.net developers" 
<hotspot-dev at openjdk.java.net>, core-libs-dev 
<core-libs-dev at openjdk.java.net>
Date:   23/02/2018 17:52
Subject:        Re: [PATCH] RFR Bug-pending: Enable Hotspot to Track 
Native Memory Usage for Direct Byte Buffers

On 23/02/2018 15:28, Peter Levart wrote:
> Hi Adam,
> Did you know that native memory is already tracked on the Java side for
> direct ByteBuffers? See class java.nio.Bits. Could you make use of it?
Right, these are the fields that are exposed at runtime via 
BufferPoolMXBean. A SA based tool could read from a core file. I can't 
tell if this is enough for Adam, it may be that the his tool reveals 
more details on the buffers in the pools.


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

More information about the core-libs-dev mailing list