# HG changeset patch # User jpai # Date 1578734573 -19800 # Sat Jan 11 14:52:53 2020 +0530 # Node ID 533fedb5ce19782b3b33476acadff7f72fb8c276 # Parent f7edb9ca045cb240d8e0ee9d5c1c1f92820da7b6 7143743: (zipfs) Potential memory leak with zip provider Summary: ZipFileSystem.close() now clears the "inodes" Map, to avoid holding on to potentially large amounts of data Reviewed-by: diff --git a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -489,6 +489,9 @@ for (Deflater def : deflaters) def.end(); } + // clear the inodes since they can potentially hold on to large amounts + // of data (especially IndexNode of type ZipFileSystem$Entry) + inodes.clear(); IOException ioe = null; synchronized (tmppaths) {