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?
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.
Heap starts at default initial value and grows to a maximum of 256 MB.
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.
In the run configuration you want to customize (just click on it) open the tab Arguments
and add -Xmx2048m
in the VM arguments section. You might want to set the -Xms
as well (small heap size).
Go to Eclipse Folder
Find Eclipse Icon in Eclipse Folder
Right Click on it you will get option "Show Package Content"
Contents folder will open on screen
If you are on Mac then you'll find "MacOS"
Open MacOS folder you'll find eclipse.ini file
Open it in word or any file editor for edit
...
-XX:MaxPermSize=256m -Xms40m -Xmx512m
...
Replace -Xms512m to -Xmx1024m
Save the file and restart your Eclipse
Have a Nice time :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With