On Oct 24, 2006, at 3:59 AM, Cohen Oren (ICS) wrote:
Thanks !
1) Is there a reason why the buffer of the AsyncAppender is
implemented
as ArrayList and not LinkedList ?
I don't believe there has been any performance testing related to the
choice of List implementation in this instance. Section 8.4.4 of
"Java Platform Performance" says:
Most of the time you need a List, the ArrayList implementation is
the best choice. ArrayList offers constant-time positional access
and is quite fast, It doesn't have to allocate a node object for
each element in the List and it uses the native method
System.arraycopy to move multiple elements simultaneously. ...
...
You might want to consider using LinkedList if you frequently add
elements to the beginning of the List or iterate over the list and
delete elements from the interior. ... However, keep in mind that
this performance gain might be more than offset by other
factors. ... The fixed overhead for LinkedList operations is also
much greater than for ArrayList operations.
AsyncAppender does not do any of the things that might suggest using
LinkedList while it does do things (like bulk copies) that ArrayList
is better at.
2) I tried to ran on log4j 1.2.14 with the following configuration,
and
got a NullPointerException (see below).
If my LocationInfo was set to "false", why did the Dispatcher get into
getLocationInformation() method ?
The pattern layout attached to the rolling file appender contains %C
and %L specifiers (for the class name and line number, respectively),
so when the event is finally handled by the appender, it tries to
collect location information from the current call stack (which will
no longer contain the location of the call since the event has been
delegated to another thread). There appears to be a bug in location
capturing code when the call stack does not include the expected
logger class. I'm guessing the same problem would also occur with
earlier versions of log4j.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]