Costin Manolache wrote:
Good point, fixing jasper servlet is a not going to help in production
env ( and precompiled jsps), so it's probably not worth it.

However - I disagree that JSPs are 'just' servlets - or at least they
should not be plain and stupid translation of text to 'println'
servlets. The current behavior of jsps wrt memory is horrible if you
have lot of content - all the plain text ends up in memory, as part of
the class. It's good for cheating on benchmarks - bad for production.
There are far better ways to use the memory.

The alternative is wasting CPU and disk reading stuff from disk all over again for nothing, which for most servers are even more useful resources. We're talking about using less than 128MB of memory here, so it's not too much (who has more than 128MB of static text in his JSPs ?).

If you're interested in the lowest footprint, JSP is not the right technology: you need a templating (or anything not compiled) technology and disable its caching features (it will be quite slow, but will use minimal amounts of resident memory). The only solution is to forbid scriptlets (or as an option use a processing when a page does not contain scriptlets - and of course, rewrite a significant amount of Jasper - way cool :D), in which case compilation is not needed, and we can simply execute the nodes (memory is saved by optionally discarding the nodes between requests).

IMO separating the strings and loading/unloading them using a cache
would help a lot in such situations ( i.e. large number of jsps ==
huge memory use ). Unloading not frequently/recently used jsps ( and
servlets, and webapps ) might also be very nice, assuming they can
handle being unloaded. But I agree that the current patch is  not the
right solution.

Unloading the servlet's instance is possible, not the class definition. Unloading webapps is not possible at the moment (even if it was, modern webapps take ages and tons of resources to start, so it wouldn't be practical IMO).

It still doesn't cost much to give some more perm gen to Sun's VM (still a fairly manageable amount IMO, but of course, if you want to do hosting or it's an embedded situation, it's a problem).

BTW, I am ok with shipping additional presentation technologies with Tomcat, we do not need to give JSP any special treatment anymore.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to