You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/08/23 04:29:21 UTC

[GitHub] [incubator-druid] dclim commented on a change in pull request #8352: Handle exception thrown in log while trying to call sun.misc.VM.maxDirectMemory() which is not available in Java 11

dclim commented on a change in pull request #8352: Handle exception thrown in log while trying to call sun.misc.VM.maxDirectMemory() which is not available in Java 11
URL: https://github.com/apache/incubator-druid/pull/8352#discussion_r316970646
 
 

 ##########
 File path: services/src/main/java/org/apache/druid/cli/GuiceRunnable.java
 ##########
 @@ -78,12 +78,20 @@ public Lifecycle initLifecycle(Injector injector)
       final Lifecycle lifecycle = injector.getInstance(Lifecycle.class);
       final StartupLoggingConfig startupLoggingConfig = injector.getInstance(StartupLoggingConfig.class);
 
+      Long directSizeBytes = null;
+      try {
+        directSizeBytes = JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes();
+      }
+      catch (UnsupportedOperationException ignore) {
+        // querying direct memory is not supported
+      }
+
       log.info(
-          "Starting up with processors[%,d], memory[%,d], maxMemory[%,d], directMemory[%,d].",
+          "Starting up with processors[%,d], memory[%,d], maxMemory[%,d]%s.",
           JvmUtils.getRuntimeInfo().getAvailableProcessors(),
           JvmUtils.getRuntimeInfo().getTotalHeapSizeBytes(),
           JvmUtils.getRuntimeInfo().getMaxHeapSizeBytes(),
-          JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes()
+          directSizeBytes != null ? String.format(", directMemory[%,d]", directSizeBytes) : ""
 
 Review comment:
   Oops, thanks Clint

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org