I run my own template engine using JSP’s. After I added some dynamic templates (I generate the JSP’s with a JSP 🙂 ) the number of JSP’s exploded and tomcat started to run slowly. So easy fix was just to allocate some more memory. I edited startup.sh:

exec "$PRGDIR"/"$EXECUTABLE" start "$@" -Xmx4096m

but the proper fix will be to unload the servlet after they are used (since they are only used once).

Also note, I’m running 64bit, so I can say 4096m 🙂 It’s nice when 64bit actually helps rather than causes you pain.

Interestingly enough, the problem can be traced to tomcat, and someone recently submitted a patch for exactly the behaviour I’m seeing!

And (Since I didn’t apply the patch), but the current last line in my startup.sh is:

exec "$PRGDIR"/"$EXECUTABLE" start "$@" -Xms4000m -Xmx5096m -XX:-UseGCOverheadLimit

okay, so that all didn’t work that great, and so I built apache with the above patch. Works great.

Leave a Reply