gianm commented on code in PR #13274:
URL: https://github.com/apache/druid/pull/13274#discussion_r1013008436


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java:
##########
@@ -282,13 +283,19 @@ private static long memoryPerBundle(
   )
   {
     final int bundleCount = numWorkersInJvm + numProcessingThreadsInJvm;
-    return (long) (maxMemoryInJvm * USABLE_MEMORY_FRACTION) / bundleCount;
+
+    // Need to subtract memoryForStatisticsTracking off the top, since this is 
reserved for statistics collection.
+    final long memoryForStatisticsTracking = (long) numWorkersInJvm * 
StageDefinition.PARTITION_STATS_MAX_BYTES;
+    final long memoryForBundles = (long) (maxMemoryInJvm * 
USABLE_MEMORY_FRACTION - memoryForStatisticsTracking);

Review Comment:
   There's a reasonable error that occurs later on; see 
WorkerMemoryParametersTest.



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