On Fri, 15 Dec 2000, David Brown wrote:
Hi David,
String usage is a big performance problem in tomcat - we are just
beginning to resolve this problem in the servlet container ( starting with
3.3, where the core will be able to work without allocating strings ),
but we will continue even after 3.3 is released, by adding optimized
interceptors.
Jasper is a bit harder, but it is possible to improve things quite a bit
with small changes in jasper ( by generating some code that
take advantage of the tomcat internals).
I started tunning memory usage in tomcat almost a year ago - and it's
still not over. It's not easy, but the results are visible - almost all of
the improvements between 3.1 and 3.2 ( and 3.3 ) are due to better memory
management.
In 3.3 we are just starting to work on other issues ( like alghoritms and
fine tunning ).
( I have little time this weekend, but there is a lot I can say about this
subject )
Costin
>
>
> "Craig R. McClanahan" wrote:
> >
> > Well, any given page creates only one instance of the servlet class, so using
> > static really would not make any difference here. The string constants are (in
> > effect) created when the class is first loaded, not on every method call. Also,
> > most JVMs implement String constants in a manner that they are shared across
> > classes and instances anyway, although there are no guarantees here.
>
> A VM has to share all String literals globally, so that given:
>
> class C1 {
> static final String s = "xxx";
> }
> class C2 {
> static final String s = "xxx";
> }
>
> it will be true that C1.s == C2.s. The java language spec
> section 3.10.5 requires this.
> http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html
> Some 1.1 VMs have a bug where its string literal table will
> overflow & crash, but that's a different story.
>
> -dave brown
>
> >
> > But people who want to work on improving the quality of the code generated by
> > Jasper are quite welcome -- in the Tomcat 4.1 time frame, I would like to see a
> > lot of attention on this particular area.
> >
> > Craig
>