[ 
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)

Reply via email to