Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase application heap size in Eclipse?

Some say I need to do that in Run Configurations for my application. When I open that window, could you please tell me how to set the right argument and the amount of memory? Say how to set 2GB or 1.5GB?

like image 530
Sophie Sperner Avatar asked Mar 09 '13 16:03

Sophie Sperner


People also ask

How do I see heap memory in Eclipse?

Goto Window > Preferences > General and enable Show heap status and click OK. In the status bar of eclipse (bottom of the screen) a new UI element will appear. We can see 3 things: The amount of used memory by the application (including garbage that has not been collected), in the example 111MB.

What is the maximum heap size in eclipse?

Heap starts at default initial value and grows to a maximum of 256 MB.

How do I increase the heap size available to Eclipse?

Temporary fix – Increase the heap size On the Eclipse menu, clicks Run -> Run Configurations.. , select the Java application we want to run, click on the Arguments tab, VM arguments section, and adjust a better Java initial maximum heap size.


2 Answers

In the run configuration you want to customize (just click on it) open the tab Arguments and add -Xmx2048min the VM arguments section. You might want to set the -Xms as well (small heap size).

like image 73
benzonico Avatar answered Sep 25 '22 01:09

benzonico


  1. Go to Eclipse Folder

  2. Find Eclipse Icon in Eclipse Folder

  3. Right Click on it you will get option "Show Package Content"

  4. Contents folder will open on screen

  5. If you are on Mac then you'll find "MacOS"

  6. Open MacOS folder you'll find eclipse.ini file

  7. Open it in word or any file editor for edit

    ...

     -XX:MaxPermSize=256m   -Xms40m   -Xmx512m 

    ...

  8. Replace -Xms512m to -Xmx1024m

  9. Save the file and restart your Eclipse

  10. Have a Nice time :)

like image 43
Faakhir Avatar answered Sep 25 '22 01:09

Faakhir