supermem613 opened a new pull request, #5439:
URL: https://github.com/apache/incubator-gluten/pull/5439

   ## What changes were proposed in this pull request?
   
   Today, in Spark we specify the on-heap and off-heap memory sizes as a 
configuration value read at the beginning of executing a job.
   
   With this change, we are exposing a new feature that is enabled with a new 
spark.gluten.memory.dynamic.offHeap.sizing.enabled setting. When this setting 
is configured to true, the offheap setting will be ignored in Gluten and we 
will size the offheap as the same size as the spark.executor.memory setting.
   
   We will then proceed to enforcing a total memory quota, calculated by the 
sum of what memory is committed and in use in the Java heap (calculated with 
Runtime.getRuntime().totalMemory() - Runtime.GetRuntime().freeMemory()) plus 
the tracked off-heap memory in TreeMemoryConsumer. When there is an allocation 
that would tide us over this total amount of committed memory, we will fail the 
allocation and trigger an OOM.
   
   Note that with this change, we perform the "quota check" when an allocation 
in the native engine is informed to Gluten. In practice, this means that it is 
possible that the Java codebase can oversubscribe memory as it allocates, which 
is under the on-heap quota, although there is enough off-heap usage where we 
should fail the allocation.
   
   A test exercising this setting is part of this change.
   
   Fixes: #5438 
   
   ## How was this patch tested?
   
   Manual testing with Spark and included test
   
   


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