[logback-dev] [JIRA] Commented: (LBCLASSIC-172) Use WeakHashMap instead of Hashtable in LoggerContext

Joern Huxhorn (JIRA) noreply-jira at qos.ch
Tue Dec 15 19:01:33 CET 2009


    [ http://jira.qos.ch/browse/LBCLASSIC-172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11464#action_11464 ] 

Joern Huxhorn commented on LBCLASSIC-172:
-----------------------------------------

I seriously understand your objections, now, and I agree that this isn't something that can be changed easily.
I guess it would be possible to work around all of those problems but this would definitely be a major amount of work, and a risky one.

And yes, given that a logger keeps a reference to every child it wouldn't change anything if Hashtable was changed to WeakHashMap since the root logger won't be collected anyway and, therefore, no child.

The reason why I submitted this as a bug was simply that it *is* a memory-leak - and I have generally a hard time to ignore such a thing ;)
It saddens me a bit to know that it's there but there's nothing that can be done about it...

> Use WeakHashMap instead of Hashtable in LoggerContext
> -----------------------------------------------------
>
>                 Key: LBCLASSIC-172
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-172
>             Project: logback-classic
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 0.9.18
>            Reporter: Joern Huxhorn
>            Assignee: Logback dev list
>             Fix For: unspecified
>
>
> Preventing garbage-collection of unused Loggers is a bad idea. 
> The following code should not fail:
> for(int i=0;i<10000000;i++) {
>   LoggerFactory.getLogger("Foo."+i).debug("Foo!");
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list