File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP - Out of Memory exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP - Out of Memory exception" Watch "JSP - Out of Memory exception" New topic

JSP - Out of Memory exception

Arun Kottol

Joined: May 24, 2004
Posts: 2
Is it possible to trap the Out of memory exception given by JSP?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
It's an Error, not an Exception.
Errors should not be caught in general because you can't do anything about them anyway.

Wendal Park
Ranch Hand

Joined: Aug 28, 2001
Posts: 39
Try break down you JSP into a couple small JSPs using the include directive.

sometimes compiling a too large JSP page may give OutOfMemoryException in Tomcat ... that's what I had before

MSc, BSc, SCJP 1.4<br /> <img src="graemlins/banghead.gif" border="0" alt="[banghead]" /> SCBCD
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
There's also a memoryleak in some versions of Tomcat pertaining to the JSP compiler where each compile will slowly eat up JVM memory until there's not enough left to even run a servlet or JSP and you'll get an OutOfMemoryError on every call.
I agree. Here's the link:
subject: JSP - Out of Memory exception
It's not a secret anymore!