You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "adarshsanjeev (via GitHub)" <gi...@apache.org> on 2023/03/01 06:17:36 UTC

[GitHub] [druid] adarshsanjeev commented on a diff in pull request #13846: Suggested memory calculation in case NOT_ENOUGH_MEMORY_FAULT is thrown.

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


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java:
##########
@@ -480,10 +480,16 @@ private static long estimateUsableMemory(
 
   }
 
+  /**
+   * Add overheads to the estimated bundle memoery for all the workers. Checkout {@link WorkerMemoryParameters#memoryPerWorker(long, int)}
+   * for the overhead cacluation outside the processing bundles.

Review Comment:
   Minor nit: calculation



##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerMemoryParameters.java:
##########
@@ -494,17 +500,18 @@ private static long memoryNeededForInputChannels(final int numInputWorkers)
   }
 
   /**
-   * 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}
+   * 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#calculateSuggestedMinMemoryFromUsableMemory}
    */
   private static long computeUsableMemoryInJvm(final long maxMemory, final long totalLookupFootprint)
   {
+    // since lookups are essentially in memory hashmap's, the object overhead is trivial hence its substracted prior to usable memory calculations.

Review Comment:
   Nit: subtracted 



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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