logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joern Huxhorn <joern.huxh...@gmx.de>
Subject Re: [PATCH] SocketAppender-patch for the ObjectOutputStream.reset()-bug.
Date Mon, 05 May 2003 17:05:45 GMT
Hi Ceki.

The memory-leak isn't there in the current implementation. You added the 
oos.reset() and wrote in the comments that it's there because a 
memory-leak would occurr if it's removed. Please ignore my first mail 
completely - I made a stupid mistake.

The objective of my second patch is to prevent blocking of the sockets 
stream by using buffers which helped reducing the data-loss-problem 
described in the javadoc of SocketAppender.
It does exactly that on my setup and shouldn't impose any problems (in 
contrast to my first patch :( ).

I seldom lose any events at all anymore even in the rather unfair 
attached Foo-class. Well, at least if Chainsaw is the active application 
which could also be fixed as described in my previous mail by changing 
the priority of chainsaw's receiver-thread to NORM_PRIORITY+1. This 
would help if Chainsaw and the logged application are running on the 
same machine (and the application uses threads with 
priority<=NORM_PRIORITY - otherwise it's just not resonable to run 
Chainsaw on the same machine...).

I think the added synchronized's are necessary and of no harm to the 
rest of the system while the synchronized(this) in line 363 of the 
original code should really be synchronized(SocketAppender.this) instead 
because it synchronizes access to the sockets stream managed by 
So these changes and the LogLog-changes are meant to be fixes. I think 
the new LogLog-behaviour fixes bug 17331 because the casual user wants 
the error-message but isn't interested in the stack-trace at all while 
the developer gets the trace if he needs it. My boss hates the current 
behaviour because it looks like an error to the end-user of the app ;)

I hope this claryfies my point a bit.
And while I have the chance: Thank you sooooo much for Log4J!


Ceki Gülcü wrote:

> Hi Joern,
> Which ObjectOutputStream-memory leak are you referring to?
> I have also looked at your next patch. I fail to understand your 
> objectives. What is the goal?
> At 11:43 AM 5/2/2003 +0200, you wrote:
>> Hi all.
>> I hope I submit this patch the right way - never did this before and 
>> tried really hard ;)
>> The attached patch fixes the problems with the 
>> ObjectOutputStream-memory leak. It does also reduce the amount of 
>> lost events if the app is terminated without calling 
>> LogManager.shutdown() first.
>> Greetings,
>> Joern.

View raw message