Setting Tomcat Heap Size (JVM Heap) in Eclipse

apache-tomcat-eclipseRecently while running Tomcat under Eclipse for one of the web application I was getting Java Heap memory related error java.lang.OutOfMemoryError.
What needs to be done here basically is to increase the jvm heap size. So for increasing the JVM Heap Size of Tomcat in Eclipse we have to set few VM arguments of the tomcat.

Follow the simple steps to change the Heap Size of Tomcat under Eclipse.
1. Open the Server tab in Eclipse and double click the Tomcat server to open Server Configuration.
eclipse-tomcat-tab

2. In Server Configuration, click on the Launch Configuration link under General Information.
tomcat-config-eclipse

3. Under Arguments tab, add following values in VM arguments.

-Xms64m -Xmx256m

tomcat-jvm-config
To know more about -Xm options read this article.



13 Comments

  • jens wrote on 17 November, 2009, 7:09

    hi,

    thanks so much for this great and helpful blog post!!! it helped me such much, thanks!!!!

    jens

  • nitin wrote on 1 July, 2010, 14:07

    Thank you very much for the screen shots..!

  • darfat wrote on 21 July, 2010, 9:07

    thanks, for this briliant article,!!

  • goldo wrote on 30 August, 2010, 20:27

    Hi,
    Thx for the tip ;)
    Is there a way to persist this change in an external config file (or other) to avoid edit launch configuration each time eclipse is restarted ?
    Thx in advance.

  • aldo wrote on 20 October, 2010, 20:50

    tnx

  • David wrote on 21 January, 2011, 6:43

    ¡Great post! Thanks from Mx

  • Geoff wrote on 1 March, 2011, 1:09

    Awesome – love succinct articles that get to the point AND are spot on.

  • Murali wrote on 21 March, 2011, 18:19

    Thanks, This helped me.

  • navneet wrote on 29 March, 2011, 8:54

    thanks its really helpfull

  • Serkan wrote on 21 June, 2011, 18:30

    Thanks mate, it is very helpful

  • Sandeep wrote on 24 June, 2011, 13:51

    bang on the target! thanks :)

  • Badal wrote on 10 August, 2011, 0:05

    awesome…to the point..thanks

  • Ritesh wrote on 18 October, 2011, 9:43

    Hi,
    Could any one explain the advantage of initializing the instance variables inside a constructor, the same thing we can do after the object has been initialized and calling the respective setters method.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Copyright © 2012 ViralPatel.net. All rights reserved.