xvrl commented on a change in pull request #7606: Set direct memory if unable 
to detect JVM config
URL: https://github.com/apache/incubator-druid/pull/7606#discussion_r282732326
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/query/DruidProcessingConfig.java
 ##########
 @@ -52,7 +52,22 @@ public int intermediateComputeSizeBytes()
       return computedBufferSizeBytes.get();
     }
 
-    long directSizeBytes = 
JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes();
+    long directSizeBytes;
+    try {
+      directSizeBytes = JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes();
 
 Review comment:
   @clintropolis agree we could add more roundabout ways of getting max memory 
size. If we feel strongly about this we can do a follow-up PR to try 
`jdk.internal.misc` as well.
   
   Either way we should have a fall-back in case the VM is running without 
`--add-exports`, and to improve compatibility with future JDK releases.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to