Skip to main content

Posts

Showing posts from February, 2015

Java Heap Space Exception, One of Weired Issue for Java Developer

Running Java application requires a lot of memory to load, execute and running. When you run one of the Java application, it does not only your application need memory but the web container such as Tomcat also required. It is more annoyed for you as a developer that you use many development tools that running on JVM such as Maven, Eclipse IDE, Tomcat and other stuffs. The memory firstly is about your RAM, regularly, you might have only 8GB RAM as normal as mine that I though it's enough but usually, it's not. Let's look to your Eclipse, the autocomplete code there, number of Java files and other automatic stuffs you do on the IDE that keeps you slowing everytimes; So that by theory, 8GB still not enough to go. Java heap issue can be solved by setting the right use of the memory as following way: -Xms<size> - Set initial Java heap size -Xmx<size> - Set maximum Java heap size Example: java -Xms512m -Xmx1024m JavaApp But never forget to calculate ho...