https://issues.apache.org/bugzilla/show_bug.cgi?id=50486

--- Comment #38 from grobmeier <[email protected]> ---
Jim, it seems the usual way to hold your memory clean is to call the clear()
method appropriate.

Ralph Goers explained on the mailinglist:

>> All the MDC is is a ThreadLocal where each Thread has its own Map associated
>> with the ThreadLocal. You can get and put all you want. In a webapp, of
>> course, if you add stuff to the MDC at the beginning of a request then you
>> need to remove it all at the end of the request.  The normal pattern is
>>
>> MDC.put(key, value);
>> try {
>>    call servlet
>> } finally {
>>   MDC.remove(key);
>> }

As far as I understand it, using the MDC.clear() method should help you in this
case (with 1.2.17). In a servlet environment, you might want to put this code
into the Servlet.destroy() method:

http://docs.oracle.com/javaee/6/api/javax/servlet/Servlet.html#destroy()

"This method gives the servlet an opportunity to clean up any
resources that are being held (for example, memory, file handles,
threads)"

Could you try out if that helps you? If it does, we'll provide accordingly
documentation and finally close the issue afterwards. If it does not, we'll do
some more bug hunting.

Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to