I am creating a program that will do 67,108,864 calculations. But when I run it, there is an error message: java.lang.OutOfMemoryError: Java heap space. I found suggestions to fix this problem in here: java.lang.OutOfMemoryError: Java heap space with NetBeans. Although I have done the suggestions, the problem is still there.
First, I have tried Michael Myers suggestion that is setting the VM Options of the Project Properties but did not get any luck. I even set the VM Options to -Xmx1024m. I am interested in James Schek statement stating that this setting don't apply to Servlet Project but only desktop project.
I have also tried Alok suggestion that is increasing virtual memory of the Tomcat server. In here I also set the VM Options to -Xmx1024m. But again did not get any luck.
And I have tried Will Hartung suggestion to disable HTTP Monitor, but again there was no change.
But I have not tried Rakesh suggestion since my computer does not allow me to change the file.
So, my questions are:
How can I fix this kind of problem in servlet project?
What is the maximum value of Xmx? Is it the capacity of the RAM?
How can I change the content of netbeans.conf file?
Environment:
8 GB RAM