You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2023/09/13 03:52:45 UTC

[GitHub] [spark] LuciferYang commented on pull request #42893: [SPARK-44459][Core] Add System.runFinalization() to periodic cleanup

LuciferYang commented on PR #42893:
URL: https://github.com/apache/spark/pull/42893#issuecomment-1716901262

   I think regularly executing `runFinalization()` may have the following effects on the system:
   
   1. Impact on performance: The overhead created by executing runFinalization() could affect system performance, especially if a large number of objects define a finalize method, as each call to this method takes time to process these objects.
   
   2. Impact on memory usage: Normally, GC and the execution of the finalize method is automatically managed by the JVM, that is, it is only executed when the object is no longer reachable and system resources are tight. Regularly calling runFinalization() might trigger additional GC when it's not needed, possibly leading to temporary increases in memory usage.
   
   3. Possible change in expected behavior: If the application relies on specific timing for the execution of the finalize method now, then regularly executing runFinalization() could disrupt this expected behavior.
   
   I have a cautious attitude towards this pr, I prefer to find the key points and change them to use methods like `try finally` to clean up resources in a timely manner. Also, the minimum supported Java version for Apache Spark 4.0 will be Java 17, does this problem still exist?


-- 
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: reviews-unsubscribe@spark.apache.org

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


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