wood burning stoves 2.0
The moose likes Tomcat and the fly likes Heap Space Error in Tomcat 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Heap Space Error in Tomcat 5.0" Watch "Heap Space Error in Tomcat 5.0" New topic

Heap Space Error in Tomcat 5.0

mallika mallikaa

Joined: Nov 01, 2011
Posts: 6
While uploading an xml file of size 9mb we are getting the following error.

java.lang.OutOfMemoryError java heap space.We are using Tomcat 5.0 and increased the heap size to 256 MB but still we are facing the error.

We have properly closed the result set,connection and prepared statement objects also.

Please suggest.
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1599
I have had similar error in past. Sometimes we deleted some files(wars) from the server, sometimes from outside of it. See if that may be the case.

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Rojan punn

Joined: Nov 29, 2011
Posts: 17


What is the server capacity?
Out of memory error suggest jvm cant allocate any more heap space .
Try some of the Memory analyzer tools(VisualVm,J console etc.)
256 looks to me like a very small amount.But it depends on the size of application and real time users.
Do you have any tool to track memory leak?and prints the memory leak on the trace file?
It is very good to have a java class which can keep track of opened resultset ,connection and gives an error or warning if the objects are not closed properly.
If its a problem with unclosed object the same problem haoppens at some stage even if you allocate 512 MB memory.

RashMin Gadhavi

Joined: Feb 12, 2008
Posts: 15
No one could get the solution for this? If yes let me know too, as I am facing this issue in my production environment!
I agree. Here's the link: http://aspose.com/file-tools
subject: Heap Space Error in Tomcat 5.0
It's not a secret anymore!