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_r282309638
##########
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:
yes, the call will always fail in Java 9 and above.
DEFAULT_PROCESSING_BUFFER_SIZE_BYTES is -1, so this logic should only apply
if they haven't configured anything and we need to auto-size the buffer.
This only changes the auto-sizing logic to assume the maximum available
direct memory is at least 25% of heap size, which should be relatively safe,
given that JDKs now default to max direct memory = max heap size.
The only reason I picked a fraction of it is to provide a better out of the
box experience for someone kicking the tires, and avoid having their memory
usage be twice as much as the heap size they configured, but I picked this
number fairly arbitrarily, so I'd be happy to revisit if we think a different
default is better.
----------------------------------------------------------------
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]