java.lang.OutOfMemoryError: Java heap space NetBeans & Tomcat
I found the problem while it is developing software that use large data. Software is built using JEE technology with Apache Tomcat as the server.
Apparently when the run on the console messages Netbean gives java.lang.OutOfMemoryError: Java heap space, after searching in google, this is because of restrictions on the use of memory (the Java Virtual Memory [JVM]) that a computer doing it in java application to wastes no memory .
But because the needs of the application on my end up making changes to the JVM used by Netbeans. After the run was still experiencing the same thing. After an investigation, it changes not only in the JVM do in Netbeans, but it should be done also on the Tomcat server.
Here’s how to change the JVM in Netbeans and Tomcat are used.
To Netbeansnya own applications can be changed at netbeans.conf in the (installation directory) \ (netbeans) \ etc
Set minimum and maximum JVM with the command -J-Xms128m -J-Xmx512m (128 and 521 values can be changed as needed)
To change the JVM for the project created using NetBeans to the File menu, select Project Property (project name), select the Run menu, input the VM option -Xms128m-Xmx512m.
As for changing the JVM in Tomcat server, the NetBeans Tools menu, Servers. Select Tomcat Server, then select the platform and put them on the VM input options -Xms128m-Xmx512m.
Now that your project was created using larger JVM, this modification is very effective for large applications, but are not recommended for small applications, because it will only waste memory resources unnecessarily.