提交 0c4ad03d 编写于 作者: L lancea

7143743: Potential memory leak with zip provider

Reviewed-by: lancea, clanger, alanb
Contributed-by: NJaikiran Pai <jai.forums2013@gmail.com>
上级 ff5fe197
/*
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -289,6 +289,14 @@ public class ZipFileSystem extends FileSystem {
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册