-
Bug
-
Resolution: Done
-
Major
-
3.1.2.GA
-
None
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.