cryptoe commented on code in PR #13846:
URL: https://github.com/apache/druid/pull/13846#discussion_r1119618849


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java:
##########
@@ -439,11 +494,19 @@ private static long memoryNeededForInputChannels(final 
int numInputWorkers)
   }
 
   /**
-   * Amount of heap memory available for our usage.
+   * Amount of heap memory available for our usage. Any computation changes 
done to this method should also be done in its corresponding method {@link 
WorkerMemoryParameters#estimateTotalMemoryInJvmFromUsableMemory}
+   */
+  private static long computeUsableMemoryInJvm(final long maxMemory, final 
long totalLookupFootprint)
+  {
+    return (long) ((maxMemory - totalLookupFootprint) * 
USABLE_MEMORY_FRACTION);

Review Comment:
   Since lookups can be really big and will only have a hashmap/hashmaps the 
overhead would be trivial hence IMO the current logic is fine. Added this 
comment there. 



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