Uargh,

Now you GOT me aware ! 

I have added the missing remove()-calls - and will
upgrade to a new log4j release as soon as possible to use the mdc.

Luckily I wrapped all log4j calls in my own Log.class - sometimes this pays
of
in spite of the performance penalty.

Thanks for your advice.

Manfred Regele 
Dipl. Betriebswirt (BA)
ADIG Investment GmbH
22 Methoden&Tools
Richard-Reitzner-Allee 2
85540 Haar
Tel: 089/46268-308
mailto:[EMAIL PROTECTED]
http://www.adig.de

> -----Ursprüngliche Nachricht-----
> Von:  Mark Womack [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Mittwoch, 2. Januar 2002 17:44
> An:   'Log4J Users List'
> Betreff:      RE: Sample usage of NDC in servlets.
> 
> Pushing the session id is a pretty good use of the NDC in servlets, and
> this
> is a good example code.  But be aware that you will need to call the
> NDC.remove() method periodically, otherwise you will end up with a huge
> memory leak over time.  Do not ignore the notes in the api documentation.
> It has my experience that a new NDC reference was created for EACH request
> object, which is stored statically in the NDC.  This caused the request
> object to not be released at the end of the request, and any attributes it
> happened to reference were not released as well.  It doesn't take much to
> see this is a problem.
> 
> Using the new MDC class might be a better way to go.  Or updating the NDC
> code to use the same mechanism as the MDC class to free memory when a
> thread
> is no longer being used.
> 
> just be aware,
> -Mark
> 
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to