You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bernd Eckenfels (JIRA)" <ji...@apache.org> on 2014/11/17 22:51:35 UTC

[jira] [Commented] (VFS-142) Clear ThreadData after all streams are closed, fixes a memory leak

    [ https://issues.apache.org/jira/browse/VFS-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14215249#comment-14215249 ] 

Bernd Eckenfels commented on VFS-142:
-------------------------------------

Hm, I don't see really a difference. Both methods will clean the value and keep the key (ThreadLocal instance) (weakly references). The Key does not contain references to VFS objects. In fact remove() seems to be a bit more efficient as it would not create the ma or insert the key if not present (anymore).


> Clear ThreadData after all streams are closed, fixes a memory leak
> ------------------------------------------------------------------
>
>                 Key: VFS-142
>                 URL: https://issues.apache.org/jira/browse/VFS-142
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Adam Heath
>         Attachments: fix_ThreadData-clear.patch, threadlocal_setNull_vs_remove_bug.patch
>
>
> After all streams are closed in FileContentThreadData, clear the ThreadLocal.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)