RFR: 8238665: Add JFR event for direct memory statistics

Erik Gahlin erik.gahlin at oracle.com
Mon Feb 10 17:52:26 UTC 2020


Hi Denghiu,

Can you explain when this event can be useful, i.e. when troubleshooting 
x etc.? This makes it easier to determine if the event should be on by 
default, if it is worth the increased startup cost that the 
instrumentation creates and what a reasonable period for the event 
should be.

src/jdk.jfr/share/classes/jdk/jfr/events/DirectMemoryStatisticsEvent.java:

@Label("TotalCapacity") -> @Label("Total Capacity")
@Label("MemoryUsed") -> @Label("Memory Used")

What is meant by 'limit'? Could we have a better field name and/or 
description that explains what this fields contains, because it is not 
obvious from that name. Fields that contains bytes, should have the 
DataAmount; annotation.

What is the value if -XX:MaxDirectMemorySize has not been set?

Can you make the event class final.

@StackTrace(false) should not be needed.

test/jdk/jdk/jfr/event/runtime/TestDirectMemoryStatisticsEvent.java:

Use try-with-resources on the Recording object.

Thanks
Erik

On 2020-02-07 06:24, Denghui Dong wrote:
> Hi,
>
> Could I have a review of a change that adds JFR event for direct memory statistics
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8238665
> Webrev: http://cr.openjdk.java.net/~ddong/8238665/webrev.00/
> Test: test/jdk/jdk/jfr/event/runtime/TestDirectMemoryStatisticsEvent.java
>
> Thanks
> Denghui Dong
>


More information about the hotspot-jfr-dev mailing list