[JAVA] Increase Eclipse heap size (eliminate out-of-memory error)

Introduction

When I added the Eclipse plug-in, I got an out-of-memory error and couldn't run it. So I increased the heap size and solved the problem.

environment

Eclipse Photon Release 4.8.0

Attempts but failures

Rewrite "eclipse.ini" in the installation destination of Eclipse.

-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.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms256m
-Xmx512m
-Xverify:none
-javaagent:dropins/MergeDoc/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar

In the above code

-Xms256m -Xmx512m

It seems to rewrite the two parts of, but maybe because of the difference in version Although the file itself is there, the content does not match the description, and it is a problem before rewriting.

Tried and succeeded

Follow the advice of a friend I added the following contents to the end of my "eclipse.ini" code.

-vmargs
-Xms512m
-Xmx1024m

The whole code of "eclipse.ini" is as follows.

-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.dataAreaRequiresExplicitInit=true
-Xverify:none
-javaagent:dropins/MergeDoc/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
-vmargs
-Xms512m
-Xmx1024m

This ensured the heap size and allowed us to add the desired plugin.

Recommended Posts

Increase Eclipse heap size (eliminate out-of-memory error)
Eclipse error