tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yaroslav Sokolov <yarick...@gmail.com>
Subject Re: What's about unloading policy of jsp-servlets ?
Date Fri, 03 Mar 2006 16:30:57 GMT
   Actually I found this strings-problem as well. I even created a patch to
test how it affects on memory filling.

   The result was the next. When strings were stored outside of *.class files,
number of loaded jsp-servlets increased about 3 times. Time of generation of
*.jsp -> *.java -> *.class files was moderate decreased. But finally, all the
memory were occupied by jsp-servlets and tomcat threw OOME exception...

(I put strings to separated file, loaded them only of necessity and kept only
soft references to these strings.)

Regards,
Yarick.

Costin Manolache wrote:
> Thanks for the patch...
> 
> This is a well known problem, JSPs are not unloaded unless the entire
> webapp is unloaded. And to make things worse - by default all JSP
> static content is compiled to strings, that take all the memory. I
> think we have ( or had ) an option to generate some non .class file -
> which could be more easily managed.
> 
> Unfortunately I'm not familiar enough with jasper code - but it looks
> good to me. The model of keeping the entire jsp static content in
> memory forever is IMO very broken... It may help cheat on some
> benchmarks ( i.e. jsp versus html, etc ), but it's wrong for real
> world.
> 
> 
> Costin
> 
> On 3/3/06, Yaroslav Sokolov <yarick123@gmail.com> wrote:
> 
>>Hi,
>>
>>I have found, that once loaded jsp-servlets are never unloaded.
>>
>>To test I just configured tomcat to process *.html files by JspServlet
>>and then traversed jdk documentation. The result was not very exciting -
>>after browsing ~ 150 pages tomcat cried "java.lang.OutOfMemoryError: Java heap space"
>>and started not to work...
>>
>>So maybe it would be not a bad idea to try to keep in memeory just some fixed
>>number of jsp-servlets ?
>>
>>I have written a sample implementation of such a policy, but it is not very elegant
>>as internal structure containing jsp-servlets, it seems, was not designed for such
actions...
>>
>>Regards,
>>Yarick.

[skipped]

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


Mime
View raw message