Yes, I think it is fine to export from java.base to jdk.jfr for this
feature.
If you would add support for other buffer pools, it should not be over
MXBeans, but using classes/interfaces that is available in java.base.
Erik
On 2020-03-05 16:19, Denghui Dong wrote:
Hi Alan and Erik,
Sorry, I'm not sure if I fully understand what you mean.
For this feature, I still think exporting jdk.internal.access to jdk.jfr is a
good solutionsince there are
some other packages has already exported to jdk.jfr in this module.
Thanks,
Denghui Dong
------------------------------------------------------------------
From:Erik Gahlin <erik.gah...@oracle.com>
Send Time:2020年3月5日(星期四) 19:55
To:董登辉(卓昂) <denghui....@alibaba-inc.com>
Cc:hotspot-jfr-dev <hotspot-jfr-...@openjdk.java.net>;
core-libs-dev <core-libs-dev@openjdk.java.net>; Alan Bateman
<alan.bate...@oracle.com>
Subject:Re: RFR: 8238665: Add JFR event for direct memory statistics
We should avoid adding a dependency on java.management. The
jdk.jfr module today only depends java.base so JFR can be used in
constrained environments. All JMX related functionality is in
jdk.management.jfr.
Erik
On 5 Mar 2020, at 10:54, Denghui Dong <denghui....@alibaba-inc.com
<mailto:denghui....@alibaba-inc.com>> wrote:
Hi Alan,
If I use ManagementFactoryHelper to get memory pools, I still
need to modify src/java.management/share/classes/module-info.java
to export sun.management, right?
Thanks,
Denghui Dong
------------------------------------------------------------------
From:Alan Bateman <alan.bate...@oracle.com
<mailto:alan.bate...@oracle.com>>
Send Time:2020年3月5日(星期四) 16:46
To:董登辉(卓昂) <denghui....@alibaba-inc.com
<mailto:denghui....@alibaba-inc.com>>; Erik Gahlin
<erik.gah...@oracle.com <mailto:erik.gah...@oracle.com>>;
hotspot-jfr-dev <hotspot-jfr-...@openjdk.java.net
<mailto:hotspot-jfr-...@openjdk.java.net>>; core-libs-dev
<core-libs-dev@openjdk.java.net
<mailto:core-libs-dev@openjdk.java.net>>
Subject:Re: RFR: 8238665: Add JFR event for direct memory statistics
On 05/03/2020 02:44, Denghui Dong wrote:
> Hi Erik,
> Updated.
> Webrev: http://cr.openjdk.java.net/~ddong/8238665/webrev.01/
>
ManagementFactoryHelper has a method to get the list of MXBeans for the
buffer pools. That could be easily changed to return an unmodifable
list. That would allow you to emit statistics for memory-mapped files
too (the current patch seems to be limited to emitting stats for direct
buffers).
-Alan.