logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: Running out of memory using AsyncAppender
Date Fri, 03 Jan 2003 10:59:43 GMT
At 10:39 03.01.2003 +0000, you wrote:
>Selwyn,
>
>Have you considered increasing the stack/heap size? Read the documentaion
>for the -Xmx -Xss java JVM options.
>
>The problem with AsyncAppender is that it runs in a one-per-instance thread
>and it has a fixed buffer size.

How many AsyncAppenders are you running?

>A more effective AsyncAppender would share a
>single thread (or maybe use a thread pool) between all instances. It would
>also use a linked list for storing log events instead of a fixed size
>buffer. This would also solve another issue the current AsyncAppender has:
>it blocks the calling thread if the buffer is full.

That is the correct behavior in order to avoid loss of events. An unbounded 
buffer would just increase memory consumption. If event loss is tolerated, 
than a non-blocking **circular** buffer would yield good results at the 
cost of event loss (when the buffer reaches full capacity).

>For these reasons I've considered writing my own AsyncAppender (I'm using it
>a lot to), I just haven't had the time to do it yet.
>
>In the mean time I think you should consider increasing the heap size to
>accommodate the excessive memory consumption.
>
>--
>
>Thomas
>

--
Ceki



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message