Uploaded image for project: 'JBoss Logging'
  1. JBoss Logging
  2. JBLOGGING-106

Log4jLoggerProvider clearNdc doesn't clear Ndc reference to threads

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          People

            jperkins-rhn James Perkins
            wburns@redhat.com Will Burns
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: