JDK-8187114 : Replace Graal's use of the management API
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-09-01
  • Updated: 2023-07-21
  • Resolved: 2023-07-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11Resolved
Related Reports
Duplicate :  
Relates :  
Description
Graal uses the following management API and some can be replaced/workaround to eliminate those dependencies.

1. RuntimeMXBean::getName to get the process ID

This can be replaced with ProcessHandle::pid added in JDK 9.

2. RuntimeMXBean::getInputArguments to get the VM arguments.

There is an internal API that Graal can use (jdk.internal.misc.VM::getRuntimeArguments).  It's not ideal but it could help eliminating this dependency.

3. ThreadMXBean.getCurrentThreadCpuTime and com.sun.management.ThreadMXBean.getThreadAllocatedBytes

There is no API in java.base to provide these metrics.   Since Graal is tied with the VM, I won't object to add an internal API to expose this information.
Comments
The GitHib Graal changes related to this issue are https://github.com/oracle/graal/commit/48b6b625b43b09f451dac5d82ca87569a1a01c61
18-04-2018

This will be fixed by JDK-8199755.
18-04-2018

Hi Jaroslav, I'm assigning this to you because it's related to JDK-8182701. Please re-assign if appropriate. Thanks, Tobias
04-09-2017

Converting this to an enhancement and targeting to JDK 10.
04-09-2017