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
Finally i found the solution for the issue
in Catalina.bat file
you can find some text like below
under that you need to put the
Heap size is larger than your computer’s physical memory. For example,
java -Xmx2g BigApp
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
The fix is to make it lower than the physical memory: java -Xmx1g BigApp