uschindler commented on a change in pull request #572:
URL: https://github.com/apache/lucene/pull/572#discussion_r776345222



##########
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:
       Oh this one has no VM options, looks like 2012, impossible to get 
reference size.




-- 
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]

Reply via email to