02 December 2013

Setting JVM memory in tomcat (Ubuntu OS)

based on this article, i want to create a note about setting JVM memory in tomcat under Ubuntu OS. first, go to /etc/default/ directory and then we need to change tomcat's file configuration (tomcat6). I put this line:
AVA_OPTS="-Djava.awt.headless=true -Xms1024m -Xmx1024m -XX:MaxPermSize=1024m -XX:+UseConcMarkSweepGC"
last, please restart your environtment (sudo /etc/init.d/tomcat6 restart) it works great!

31 July 2012

Eclipse Tomcat java.lang.OutOfMemoryError: PermGen space

Hi guys, pernah mengalami error seperti berikut ketika menjalankan eclipse & apache tomcat?
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
    at java.lang.Class.getName0(Native Method)
    at java.lang.Class.getName(Unknown Source)
    at java.lang.Throwable.toString(Throwable.java:342)
    at java.lang.String.valueOf(Unknown Source)
    at java.io.PrintStream.println(Unknown Source)
    at org.apache.tomcat.util.log.SystemLogHandler.println(SystemLogHandler.java:269)
    at java.lang.Throwable.printStackTrace(Throwable.java:461)
    at java.lang.Throwable.printStackTrace(Throwable.java:451)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)

Ok, untuk mengatasi hal ini klik menu Run -> Run Configurations -> Apache Tomcat -> Tomcat V7.0
pada bagian tab Arguments tambahkan script berikut pada field VM Arguments:

-Xms128m -Xmx256m -XX:MaxPermSize=256m

kemudian klik apply dan run ;)