[jboss-jira] [JBoss JIRA] (JBLOGGING-106) Log4jLoggerProvider clearNdc doesn't clear Ndc reference to threads

Sanne Grinovero (JIRA) issues at jboss.org
Fri Nov 7 07:46:32 EST 2014


     [ https://issues.jboss.org/browse/JBLOGGING-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanne Grinovero updated JBLOGGING-106:
--------------------------------------
    Fix Version/s: 3.2.0.Beta2


> Log4jLoggerProvider clearNdc doesn't clear Ndc reference to threads
> -------------------------------------------------------------------
>
>                 Key: JBLOGGING-106
>                 URL: https://issues.jboss.org/browse/JBLOGGING-106
>             Project: JBoss Logging
>          Issue Type: Bug
>          Components: jboss-logging-log4j
>    Affects Versions: 3.1.2.GA
>            Reporter: William Burns
>            Assignee: James Perkins
>             Fix For: 3.2.0.Beta2
>
>
> The Log4jLoggerProvider have a method clearNdc on it that calls to the NDC.clear method.  Unfortunately this method only clears the Stack that log4j1.2 holds internally in it's NDC class.  Unfortunately this leaves the entry still in the NDC class for the current thread pointing to that stack.  If we use the remove method instead it will remove the entry from the NDC Hashtable and allow the thread to be GC'd if it is no longer running and referenced.
> Without this change there is no way to clear the NDC table which will eventually cause an OOM unless we call directly into the log4j NDC class to clear it.



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the jboss-jira mailing list