Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

direct_max stats missing on newer JDKs #47210

Open
ywelsch opened this issue Sep 27, 2019 · 3 comments
Open

direct_max stats missing on newer JDKs #47210

ywelsch opened this issue Sep 27, 2019 · 3 comments
Labels
>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team

Comments

@ywelsch
Copy link
Contributor

ywelsch commented Sep 27, 2019

The MaxDirectMemorySize information, which is reported as direct_max in the node info APIs, is no longer correctly reported on newer JDKs. In particular, it's missing with the bundled JDK. The reason is that VM class has moved from the sun.misc to the jdk.internal.misc package, which means that the following lines of code are not working anymore on newer JDKs:

Class<?> vmClass = Class.forName("sun.misc.VM");
directMemoryMax = (Long) vmClass.getMethod("maxDirectMemory").invoke(null);

@ywelsch ywelsch added >bug :Core/Infra/Core Core issues without another label labels Sep 27, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

pugnascotia added a commit to pugnascotia/elasticsearch that referenced this issue Feb 26, 2020
@pugnascotia pugnascotia self-assigned this Feb 26, 2020
@pugnascotia pugnascotia removed their assignment Mar 30, 2020
@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@williamrandolph
Copy link
Contributor

williamrandolph commented Jan 7, 2021

I'm reviewing this issue for the Core/Infra team issue triage. I'd like to discuss whether we should consider removing stats that we can't correctly report from the node info APIs.

image

Note that the intent of the JDK developers is that classes in jdk.internal should be internal to the JDK and eventually will be made inaccessible. See this comment for details: #42748 (comment)

@williamrandolph williamrandolph added team-discuss and removed needs:triage Requires assignment of a team area label labels Jan 7, 2021
@williamrandolph
Copy link
Contributor

We discussed this in a team meeting today. We know that we use direct_max size in our ergonomics code, but we get that value by parsing the output of a JVM command, not by using the jdk.internal class directly. If these values are (1) static over the runtime of the application, and (2) something we can derive from a java command, we can find a way to pass them in at startup and report them here.

If one of those conditions is not met for one of these stats, that is, if the value changes or can't be retrieved at start time, then we should deprecate and remove that stat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants