I have tried increasing my java heap memory by adding -Xms10g
and -Xmx12g
to my eclipse.ini
file (My RAM is 16GB, and I know 10G is too much but I just wanted to make sure that's not what's causing the issue). Eclipse seems to have absorbed that because the memory usage bar in bottom right corner reflects that change:
edit: (I added -Xms8g -Xmx10g
in the run config too. The results remained the same. Read along.)
However, when I run something on eclipse, as soon as it reaches around 4GB of memory it gives me a java.lang.OutOfMemoryError: Java heap space
error. Moreover, when I look at memory usage in VisualVM, I see a "Max" above the graph that says 4,294MB.
I also tried getting my actual max memory limit using terminal, and if I did it correctly, looks like it's really set to 4.294GB:
Can someone tell me why I can't get to memory usages above 4.294GB? What should I change other than eclipse.ini? (I've also tried adding -Xmx8g
as a runtime parameter in my JRE settings but no luck.)
P.S: Here is the full content of the eclipse.ini file per a user's request:
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1300.v20200819-0940
-product
org.eclipse.epp.package.java.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms10g
-Xmx12g
--add-modules=ALL-SYSTEM
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts