Tuesday 20 March 2018

How to resolve Eclipse out of memory error?

In this post, I am going to show you how to resolve the out of memory error problem in eclipse.

Whenever you face out of memory problem in eclipse, launching the eclipse with more heap size can be one solution to resolve the problem.

There are many ways to increase the application heap size in Eclipse.
a.   Launching Eclipse by passing the heap size
b.   Configuring heap size in eclipse.ini file
c.   Updating vm arguments of installed jre

Launching Eclipse by passing the heap size
eclipse [normal arguments] -vmargs -Xmx512M [more VM args]

Above command launch the eclipse with heap size of 512MB.

Configuring heap size in eclipse.ini file
You can configure the heap size in ‘eclipse.ini’ file.

Here is an example.

-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m


In windows, you can find eclipse.ini file in the same directory as eclipse.exe file.


Updating vm arguments of installed jre
Open Eclipse.


Select the installed jre and click on Edit button

Add the vm arguments and click on the button Finish.

How to resolve the problem 'OutOfMemoryError: Permgen space'?
By increasing the permgen space, you can resolve above error.

By using below option, you can increase perm gen space.
-XX:MaxPermSize=512M

You may like
Previous                                                    Next                                                    Home

No comments:

Post a Comment