Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java out of memory error-heap space

I'm developing web application in jsp/servlet,i had an issue with netbeans and Java. My program needs large data process. So I used -Xmx512m to increase the maximum heap size via

Tools -> Servers -> on the Platform tab there is a VM option below Java Platform. Then it works fine..

Now my issue is i'm building the WAR file, directly deployed and run in my another machine Tomcat for demo, here i'm facing the same issue java out of memory error-heap space i also tried with

environment variable set CATALINA_OPTS=-Xms512m -Xmx512m

this also didn't help me

how to resolve this issue?, Please point me to the right direction

like image 616
Sathish Avatar asked Sep 11 '12 09:09

Sathish


1 Answers

Try to set PermSizeand MaxPermSize values and that should be set at tomcat startup in Catalina.bat and then stop and start using this script.

  set CATALINA_OPTS=-server -Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m

http://javahowto.blogspot.co.uk/2006/06/6-common-errors-in-setting-java-heap.html

like image 85
amicngh Avatar answered Oct 04 '22 05:10

amicngh