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