Skip to content
Permalink
Browse files

7143743: Potential memory leak with zip provider

Reviewed-by: lancea, clanger, alanb
  • Loading branch information
jaiforums authored and Lance Andersen committed Jan 15, 2020
1 parent d34f561 commit ec5869eb2e10a99531981a6537002a7171fc3462
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -490,6 +490,14 @@ public void close() throws IOException {
def.end();
}

beginWrite(); // lock and sync
try {
// Clear the map so that its keys & values can be garbage collected
inodes = null;
} finally {
endWrite();
}

IOException ioe = null;
synchronized (tmppaths) {
for (Path p : tmppaths) {

0 comments on commit ec5869e

Please sign in to comment.
You can’t perform that action at this time.