RFR 7143743: (zipfs) Potential memory leak with zip provider

Alan Bateman Alan.Bateman at oracle.com
Sat Jan 11 10:07:28 UTC 2020


On 11/01/2020 09:51, Jaikiran Pai wrote:
> :
>
> The commit here fixes that issue by simply clearing the "inodes" map in
> the jdk.nio.zipfs.ZipFileSystem.close() method. I have checked the usage
> of the "inodes" map and from what I see, it's usage in various places is
> guarded by "ensureOpen" checks, which means that once the ZipFileSystem
> instance is closed, the contents of these "inodes" map is no longer
> relevant and hence clearing it shouldn't cause any issues.
>
Clearing the inodes map should be okay for cases where something is 
holding a reference to a closed zip file system. However, you should 
look at beginWrite/endWrite so that all access to the map is 
consistently synchronized.

-Alan.


More information about the core-libs-dev mailing list