• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Java Heap Space - OutOfMemory Error

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I start my web application in Tomcat5.5, I am getting outofmemory error. I increased heap size to 1.5G in catalina.bat as below
set CATALINA_OPTS="-Xms1024m -Xmx1536m", but stil the same error. When I checked JConsole, the max memory commited is showing as 65MB instead of 1.5GB. any idea what is going wrong, is that catalina options is not taken into account. any help is appreciated.

thanks
keerthi
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this question is specific to Tomcat, I have moved it to an appropriate forum for you.
CarefullyChooseOneForum
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In addition to increasing heap size, you can try increasing "perm size", a memory area which sits next to the heap. All the binary code of currently running classes is archived in the �perm� area.

The �perm� area is important if your application or any of the third party jar files you use dynamically generate classes. For example: �perm� space is consumed when XSLT templates are dynamically compiled into classes, J2EE
application servers, JasperReports, JAXB etc use Java reflection to dynamically generate classes and/or large amount of classes in your application.

To increase perm space:

Java -XX:PermSize=256M -XX:MaxPermSize=256M or make an appropriate change in catalina.bat
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Keerthi: I am getting outofmemory error



Its always better to TellTheDetails. Can you give us the stack trace.
If it is a perm gen out of memory, the error would have specified it and it would have been easy to tell you straight away that you need to increase the perm gen size.
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic