SoftReferences not cleaned up
Nicolae Mihalache
xpromache at gmail.com
Thu Jul 13 14:30:20 UTC 2017
Finally I see the light...
I was confused between objects referred by soft references not being
cleared by GC (they were) and the SoftReference object themselves which
were supposed to be removed from the ReferenceQueue by another thread which
was never started.
My problem was all due to a bug in Apache VFS which was actually fixed 2
years ago (but I never updated to the new version):
https://issues.apache.org/jira/browse/VFS-480
nicolae
On Thu, Jul 13, 2017 at 9:48 AM, Nicolae Mihalache <xpromache at gmail.com>
wrote:
> After running for two days:
>
> - jmap -histo:live <pid>|grep SoftReference
> -> reports 191255 SoftReference objects in he heap
>
>
>
> - grep GC <log-file> |sed -r 's/^.*SoftReference, ([0-9]+).*$/\1/g' |
> awk '{s+=$1} END {print s}'
> -> reports 301025 soft references cleared
>
> I had a look through a heap dump and I see most of the 191K SoftReferences
> objects with the referent null. In fact there is one ReferenceQueue with
> 179K queue length where most SoftReference in that queue are like this
> (i.e. refer to null).
> So the question is why those SoftReference objects keep accumulating in
> the ReferenceQueue and they are not cleaned up after the object they refer
> to is cleaned.
>
>
> nicolae
>
>
>
>
> On Wed, Jul 12, 2017 at 9:18 PM, yu.zhang at oracle.com <yu.zhang at oracle.com>
> wrote:
>
>> Hi,
>>
>> From the gc logs the SoftReferences are not that many.
>>
>> Thanks
>>
>> Jenny
>>
>> On 07/11/2017 01:37 AM, Nicolae Mihalache wrote:
>>
>> Here is a new output with PrintReferenceGC on:
>> https://drive.google.com/open?id=0B8_hkIRtZSShWTVpeVFONGlqVjQ
>>
>> I see that each time when I run jmap -histo:live a few hundreds of them
>> are collected but still the number reported by jmap keeps increasing (5665
>> last time it was run).
>>
>> On Mon, Jul 10, 2017 at 6:30 PM, yu.zhang at oracle.com <yu.zhang at oracle.com
>> > wrote:
>>
>>> Can you add PrintReferenceGC to print out number of references for each
>>> gc?
>>>
>>> Thanks
>>>
>>> Jenny
>>>
>>> On 07/10/2017 05:52 AM, Nicolae Mihalache wrote:
>>>
>>> I didn't have verbose gc enabled but I did enable it, and here is the
>>> log in the last 3 days:
>>> https://drive.google.com/drive/u/0/folders/0B8_hkIRtZSShdkdUTGhRMjNPVVk
>>>
>>>
>>> The "Full GC" is related to a jmap -histo:live I was running.
>>>
>>> On Fri, Jul 7, 2017 at 11:16 PM, Bernd Eckenfels <ecki at zusammenkunft.net
>>> > wrote:
>>>
>>>> Can you upload the verbose GC log somewhere? I suspect you don't see
>>>> old/mixed GCs since 30h.
>>>>
>>>> Gruss
>>>> Bernd
>>>> --
>>>> http://bernd.eckenfels.net
>>>> ------------------------------
>>>> *From:* hotspot-gc-use <hotspot-gc-use-bounces at openjdk.java.net> on
>>>> behalf of Nicolae Mihalache <xpromache at gmail.com>
>>>> *Sent:* Friday, July 7, 2017 1:58:11 PM
>>>> *To:* hotspot-gc-use at openjdk.java.net
>>>> *Subject:* SoftReferences not cleaned up
>>>>
>>>> Hello,
>>>>
>>>> I have problems understanding why the SoftReferences are not cleaned
>>>> up. This is my version of java:
>>>> java -version
>>>> java version "1.8.0_92"
>>>> Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
>>>> Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
>>>>
>>>> and I run it with the options -Xmx512m -XX:SoftRefLRUPolicyMSPerMB=1
>>>>
>>>> Still the number of SoftReferences keep increasing and I see that some
>>>> of them are 30+ hours old. I have a heap dump:
>>>> https://drive.google.com/open?id=0B8_hkIRtZSShNUtTZUx3UTFuMEk
>>>>
>>>> I don't know how to debug further, any hint would be appreciated.
>>>>
>>>> thanks,
>>>> nicolae
>>>>
>>>> _______________________________________________
>>>> hotspot-gc-use mailing list
>>>> hotspot-gc-use at openjdk.java.net
>>>> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> hotspot-gc-use mailing listhotspot-gc-use at openjdk.java.nethttp://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>>>
>>>
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20170713/a60d2c05/attachment.html>
More information about the hotspot-gc-use
mailing list