I am creating a program that will do 67,108,864 calculations using Netbeans. But when I run it, there is an error message: java.lang.OutOfMemoryError: Java heap space.
I have tried several things to overcome this problem:
1. I changed the setting of VM Options of the Project Properties. I even set the VM Options to -Xmx1024m.
2. I changed the setting of VM Options of the Tomcat Server. Here, I also set the VM Options to -Xmx1024m.
3. I disabled the HTTP Monitor.
What I have not tried is changing the content of netbeans.conf file since my computer does not allow me to change it.
So, my questions are:
1. How can I fix this kind of problem in a servlet project?
2. What is the maximum value of Xmx? Is it the capacity of the RAM?
3. How can I change the content of netbeans.conf file?
Environment:
8 GB RAM