uschindler commented on a change in pull request #572:
URL: https://github.com/apache/lucene/pull/572#discussion_r776344665
##########
File path: lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
##########
@@ -153,6 +154,19 @@ private RamUsageEstimator() {}
}
} catch (@SuppressWarnings("unused") ReflectiveOperationException |
RuntimeException e) {
isHotspot = false;
+ final Logger log = Logger.getLogger(RamUsageEstimator.class.getName());
+ final Module module = RamUsageEstimator.class.getModule();
+ final ModuleLayer layer = module.getLayer();
+ // classpath / unnamed module has no layer, so we need to check:
+ if (layer != null
+ &&
layer.findModule("jdk.management").map(module::canRead).orElse(false) == false)
{
+ log.warning(
+ "Lucene cannot correctly calculate object sizes on 64bit JVMs,
unless the 'jdk.management' Java module "
+ + "is readable [please add 'jdk.management' to modular
application either by command line or its module descriptor]");
+ } else {
+ log.warning(
+ "Lucene cannot correctly calculate object sizes on 64bit JVMs
that are not based on Hotspot.");
Review comment:
Looks like we can use this one:
https://github.com/eclipse-openj9/openj9/blob/master/jcl/src/jdk.management/share/classes/openj9/lang/management/OpenJ9DiagnosticsMXBean.java
Will be a separate PR later. Thanks for trying.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]