JavaBeat

  • Home
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Privacy
  • Contact Us

How To Increase Heap Size in Eclipse?

November 26, 2013 by Krishna Srinivasan Leave a Comment

If you get the error java.lang.OutOfMemoryError: Java heap space while running Java applications, it means that your Java application environment don’t have the sufficient space to store the values needed for your application. This could be because of the following reasons:

  • By mistake, you have set the less memory for your Java environment (or)
  • Your epplication is huge and allocated memory is not enough for your application’s size

In the either case, increasing the size of the memory is the solution. You can update the VM arguments as below to fix this issue. You have to select the application and update the required value as -Xms512M -Xmx1024M. This would resolve the problem while that application is running.

eclipse-heap-size

By default, eclipse.ini file under the Eclipse folder has the default configuration for the heap size. Note that it is used only for the Eclipse IDE. When you build your project using ANt / Maven tools, the external JVM is used and the values used in the eclipse.ini will not be used. If you update the values also will not resolve the problem. The sample eclipse.ini file looks like this. launcher.XXMaxPermSize parameter has to be increased for the heap size for your eclipse environment.

[code]
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m
[/code]

Filed Under: Eclipse Tagged With: Eclipse, heap

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Us

  • Facebook
  • Pinterest

As a participant in the Amazon Services LLC Associates Program, this site may earn from qualifying purchases. We may also earn commissions on purchases from other retail websites.

JavaBeat

FEATURED TUTORIALS

Answered: Using Java to Convert Int to String

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Copyright © by JavaBeat · All rights reserved