srowen opened a new pull request #23424: [SPARK-24421][CORE][FOLLOWUP] Use 
normal direct ByteBuffer allocation if Cleaner can't be set
URL: https://github.com/apache/spark/pull/23424
 
 
   ## What changes were proposed in this pull request?
   
   In Java 9+ we can't use sun.misc.Cleaner by default anymore, and this was 
largely handled in https://github.com/apache/spark/pull/22993 However I think 
the change there left a significant problem.
   
   If a DirectByteBuffer is allocated using the reflective hack in Platform, 
now, we by default can't set a Cleaner. But I believe this means the memory 
isn't freed promptly or possibly at all. If a Cleaner can't be set, I think we 
need to use normal APIs to allocate the direct ByteBuffer.
   
   According to comments in the code, the downside is simply that the normal 
APIs will check and impose limits on how much off-heap memory can be allocated. 
Per the original review on https://github.com/apache/spark/pull/22993 this much 
seems fine, as either way in this case the user would have to add a JVM setting 
(increase max, or allow the reflective access).
   
   ## How was this patch tested?
   
   Existing tests. This resolved an OutOfMemoryError in Java 11 from TimSort 
tests without increasing test heap size. (See 
https://github.com/apache/spark/pull/23419#issuecomment-450772125 ) This 
suggests there is a problem and that this resolves it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to