JDK-8193685 : Make cleanup registration more robust in ZIP Inflater/Deflater (enhancement of JDK-8193507)
  • Type: Enhancement
  • Component: core-libs
  • Affected Version: 10
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2017-12-18
  • Updated: 2017-12-18
Related Reports
Relates :  
Description
JDK-8193507 replaced finalization with Cleaner API for automatic native resource cleanup in ZIP Inflater/Deflater. The code could be improved with little effort to be more robust in situations when Clenaer.register fails with OutOfMemoryError due to the need to allocate object(s). Simply moving the native resource allocation after the Cleaner.register achieves the desired effect.
Comments
Here's the proposed change: http://cr.openjdk.java.net/~plevart/jdk-dev/8193685_ZipInDeFlater_cleanupImprovement/webrev.01/
18-12-2017