<AWT Dev> [JDK-8175015] FileSystemView.isDrive(File) memory leak on "C:\" file reference
krishna.addepalli at oracle.com
Thu Aug 24 09:49:37 UTC 2017
The root cause for the OOM exception is due to mismatched thread priority. When folders are listed, each folder/file is associated with a COM object, that is wrapped by the Java ShellFolder object. Now, when the ShellFolder object needs to be deleted, the underlying COM object should be released in ComThread, whose priority is normal. Whereas, the java2D.Disposer thread runs at highest priority, but it is unable to clean up the piled up objects, which eventually leads to this exception.
I have added a fix for this as well, and created a new webrev as below:
From: Sergey Bylokhov
Sent: Wednesday, August 9, 2017 5:16 AM
To: Krishna Addepalli <krishna.addepalli at oracle.com>; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [JDK-8175015] FileSystemView.isDrive(File) memory leak on "C:\" file reference
Hi, Krishna.> The problem is internally, Win32ShellFolderManager2.java, the function
> "isFileSystemRoot" is called, which lists the contents of all the root
> drives, in addition to including them. It also includes the hidden
> files. For each file present, it is wrapped with a "Win32ShellFolder2"
> object. So, for each query, it will list the files in the drives, and
> throws them away, which is leading to both memory consumption as well
> as slow performance.
If for each query we list the files in the drive and *throws* all of them away, then why(and where) we have a memory leak and as a result OOM.
Best regards, Sergey.
More information about the awt-dev