-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Info on compressed ordinary object pointers #15489
Conversation
This provides log messages on startup that look like
and
and provides a |
Woo! The log message LGTM, but I don't think I'm qualified to comment on the JvmInfo code itself :) Should this be added to the |
VMOption usingCompressedOopsVmOption = hotSpotDiagnosticMXBean.getVMOption("UseCompressedOops"); | ||
info.usingCompressedOops = Boolean.parseBoolean(usingCompressedOopsVmOption.getValue()); | ||
} catch (Throwable t) { | ||
info.usingCompressedOops = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false or "unknown"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nik9000 I considered that and I don't mind going either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer if it were just a string/enum/whatever that made the logs and api spit out "true"/"false"/"unknown".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nik9000 Done in c20d5e41b12105045ee19834bc3b18ea906dddd3.
@polyfractal I considered that and I ultimately decided against; the reason that I decided against is because nearly all of the information that is in
It's possible. |
Makes sense. Someone would only need to check this once, and you'd never need to monitor it dynamically... no need to clutter up the cat endpoint with it :) |
Is reflection on this API really allowed in java 9? We should not add this if not. |
@rmuir Compiled with the "using_compressed_ordinary_object_pointers": true,
"version": "9-ea",
"vm_name": "Java HotSpot(TM) 64-Bit Server VM",
"vm_vendor": "Oracle Corporation",
"vm_version": "9-ea+96-2015-12-10-032020.javare.4030.nc" |
LGTM if @rmuir is ok with it. |
that is not a jigsaw build. |
@rmuir Oops, I had "using_compressed_ordinary_object_pointers": true,
"version": "9-ea",
"vm_name": "Java HotSpot(TM) 64-Bit Server VM",
"vm_vendor": "Oracle Corporation",
"vm_version": "9-ea+96-jigsaw-nightly-h4080-20151215" |
OK, looks good, thanks for checking, like the other management apis we do this trick for, it is a public api (just not guaranteed in all jvms) and the reflection is correct. |
This commit adds to JvmInfo the status of whether or not compressed ordinary object pointers are enabled. Additionally, logging of the max heap size and the status of the compressed ordinary object pointers flag are provided on startup. Relates #13187, relates elastic/elasticsearch-definitive-guide#455
Info on compressed ordinary object pointers
Thanks for reviewing @nik9000, @rmuir, and @polyfractal. |
ByteSizeValue maxHeapSize = JvmInfo.jvmInfo().getMem().getHeapMax(); | ||
Boolean usingCompressedOops = JvmInfo.jvmInfo().usingCompressedOops(); | ||
String usingCompressedOopsStatus = usingCompressedOops == null ? "unknown" : Boolean.toString(usingCompressedOops); | ||
logger.info("heap size [{}], compressed ordinary object pointers [{}]", maxHeapSize, usingCompressedOopsStatus); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I am late, but I think this should go under debug logging, as by default, this will be logged each time a node starts, and I don't think it is important enough to log each time a node starts...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm, maybe heap size I guess? was that the aim here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I am late, but I think this should go under debug logging, as by default, this will be logged each time a node starts, and I don't think it is important enough to log each time a node starts...
@kimchy We log mount points, disk space metrics, whether or not the disks are maybe spinning and the underlying file system types at the info level; I opted for consistency with that.
This commit adds to JvmInfo the status of whether or not compressed
ordinary object pointers are enabled. Additionally, logging of the max
heap size and the status of the compressed ordinary object pointers flag
are provided on startup.
Relates #13187, relates elastic/elasticsearch-definitive-guide#455