james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Fondermann" <bernd.fonderm...@googlemail.com>
Subject Re: isLogEnabled() and StringBuffer
Date Tue, 14 Nov 2006 10:07:24 GMT
:-) thanks, interesting read.

although I must admit that my memory/GC statement indeed was a bit
sloppy and is not covered here, AFAICS.

  Bernd

On 11/14/06, Stefano Bagnara <apache@bago.org> wrote:
> Maybe this helps on this topic:
> http://wiki.java.net/bin/view/Javapedia/AlwaysUseStringBufferMisconception#Concatenating_Literal_Strings
>
> Stefano
>
> Danny Angus wrote:
> > On 11/14/06, Bernd Fondermann <bernd.fondermann@googlemail.com> wrote:
> >> On 11/14/06, Joachim Draeger <jdraeger@gmx.de> wrote:
> >
> >> Memory garbage should not be a problem any longer in the light of
> >> generational GCs.
> >
> > I'm not sure how you arrive at this sweeping conclusion!
> > Profligate use of memory is a problem no matter what CG algorythm you
> > use because even if the collector is capable of collecting it uses
> > clock cycles to do it. This is a cost. If your application is reaching
> > the bounds of its resources, because it is under heavy load, then
> > unecessary use of cpu or memory will be a factor in the limits of
> > performance which you can reach.
> >
> > A large number of string concatenations will always result in a lot of
> > allocations, even if it is optimised to use StringBuffer, unless you
> > are using StringBuffer directly you will have a string (or byte[] or
> > whatever) as input for each component part, a string buffer which is
> > larger than the output and an output string. Thus you use 200% more
> > memory than not doing it at all.
> >
> > d.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message