Re: AW: Re: AW: Unnecessary garbage

2007-01-26 Thread Thomas Kathmann
Wyss Patrick wrote: ... generating unnecessary String objects ... // to log a new message buf.clear(); buf.append("some string here"); this creates a String object on every call as well... it's the same as: buf.append(new String("some string here")); how much would you bet :-] I wrote

AW: Re: AW: Unnecessary garbage

2007-01-24 Thread Wyss Patrick
> > No, I don't think so. "some string here" is a constant. It gets > > interned. No new object gets created on each call. The String gets > > created once when the class loads. > > how much would you bet :-] > ooops i guess i was wrong here :-} apologies for opening my big mouth ;-) --

AW: Re: AW: Unnecessary garbage

2007-01-24 Thread Wyss Patrick
> Internally, I'm sure the info() method is calling Object.toString(), > which does create a new String object. you are right Layout.format will turn it into a String. smart appenders do this using StringBuffer/Builder. format could format to a StringBuffer/Builder but this does not realy matte