The problems with StringBuilders...
Andrew Haley
aph@redhat.com
Tue Oct 4 15:13:00 GMT 2005
Radu Racaru writes:
> On 10/4/05, Andrew Haley <aph@redhat.com> wrote:
> > Radu Racaru writes:
> > > Escape analysis is an old item on the gcj todo list, fortunately
> > > I've seen it working in Excelsior JET to say that it really does
> > > what it should do regarding the performance.
> >
> > Ah, that's interesting. What do they do with inheritance? Perhaps
> > methods have to be final to be analyzed, or they do whole-program
> > optimization?
>
> they have a paper here http://www.excelsior-usa.com/pdf/StackAlloc.pdf
Mmm yeah, that's much the same as the IBM paper. They don't say much
about inheritance. I suppose they have to assume that any (non-final)
method in a (non-private) class may be overridden, and thus every
object passed to such a method escapes.
I suppose much of the memory allocation in Java is short-lived objects
that don't get passed to methods that the user may overriden, and
therefore there is some significant gain from escape analysis.
One thing that does bother me is stack size. Java threads tend to
have small stacks, and in some Java applications there are very many
threads.
Andrew.
More information about the Java
mailing list