<AWT Dev> [10][JDK-8175015] FileSystemView.isDrive(File) memory leak on "C:\" file reference

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Wed Aug 30 08:30:13 UTC 2017


One thing, if sf.isFileSystem() is true and sf.parent is NULL, then in 
previous case, it falls through but with this fix, it returns false. Can 
you clarify?

Regards
Prasanta
On 8/30/2017 11:42 AM, Sergey Bylokhov wrote:
> Ok, looks fine.
>
> ----- krishna.addepalli at oracle.com wrote:
>
>> Hi Sergey,
>>
>> 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.
>>
>> Thanks,
>> Krishna
>>
>> -----Original Message-----
>> 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> [10][JDK-8175015] FileSystemView.isDrive(File)
>> memory leak on "C:\" file reference
>>
>> Hi, Krishna.
>> 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
>>> below:
>>>
>>> http://cr.openjdk.java.net/~pkbalakr/Krishna/8175015/webrev01/
>>>
>>> Thanks,
>>> Krishna
>>>
>>> -----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> [10][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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20170830/c4f5deb4/attachment-0001.html>


More information about the awt-dev mailing list