<AWT Dev> [JDK-8175015] FileSystemView.isDrive(File) memory leak on "C:\" file reference
krishna.addepalli at oracle.com
Tue Aug 29 04:51:48 UTC 2017
I checked with Thread.MAX_PRIORITY - 1, and found that it still leads to OOM exception, although it takes longer to get to that condition.
From: Sergey Bylokhov
Sent: Tuesday, August 29, 2017 6:19 AM
To: Krishna Addepalli <krishna.addepalli at oracle.com>
Cc: awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [JDK-8175015] FileSystemView.isDrive(File) memory leak on "C:\" file reference
Did you check other priorities like Thread.MAX_PRIORITY-1/2/3?
----- krishna.addepalli at oracle.com wrote:
> Hi Sergey,
> 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
> -----Original Message-----
> 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
> > drives, in addition to including them. It also includes the hidden
> > files. For each file present, it is wrapped with a
> > object. So, for each query, it will list the files in the drives,
> > throws them away, which is leading to both memory consumption as
> > 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
> Best regards, Sergey.
More information about the awt-dev