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

Out of memory problem !

Dharmin Desai
Ranch Hand

Joined: Feb 28, 2002
Posts: 81
dear friends,
My JSP when executes give me " Servlet Exception " under which it is showing " java.lang.OutofMemoryError " as a root cause.
I m using tomcat as my container !
Can anybody help ?
- Dharmin

SCJP2 (93%),SCWCD(88%)<br />-------------------------------<br />Never under estimate yr self, just represent yr profile in proper manner.
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
I have only really seen this error when there is something like an infinite loop which is results in the creation of a large number of object instances.
I'd have a good look at the JSP code, suggest that you post it's contents here if it's not too large.
If it is large then try commenting out various bits of the JSP to see which sections make it fail.
Andy Bowes

Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Joe Broderick

Joined: Apr 23, 2003
Posts: 23
what kind of pc and how much memory do you have? i have never seen this error, and i do most of my coding on a pII266 with 64 megs, although i just added a litte more ram to 96 megs.
Ken Januski
Ranch Hand

Joined: Aug 08, 2002
Posts: 130
Upping the initial heap size and maximum heap size for Tomcat can give you more memory than the default, whose numbers I forget.
I changed them when I ran into occasional out of memory errors. I haven't run into them again but since they only occurred once a month or so and since I only made the change a month or so ago it's a little too early to tell if it worked.
But if the jsp throws out of memory errors every time it's run then I'd guess there's something wrong in the code, as others have sugggested.
I agree. Here's the link:
subject: Out of memory problem !
It's not a secret anymore!