STS/Eclipse not passing vmargs to run configuration

Priyesh Kumar :

I am parsing a file using ANTLR4. It is giving out of memory exception. So I increased heap memory in sts.ini and eclipse.ini. Below is my sts.ini file.

-startup
plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.900.v20180922-1751
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
-XX:MaxPermSize=2048m
-Dosgi.module.lock.timeout=10
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx2048m
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms512m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+UseFastAccessorMethods

The heap memory is increased. I can see in heap status bar of eclipse/sts. But still the program is failing.

When I am passing -Xmx1024m in run configuration, the program is succeeded. Any reason why eclipse/sts is not passing these vmargs to run configuration?

Update: I verified the memory using Runtime.getRuntime().maxMemory();, it shows 512 MB without run configuration, and 2 GB with run configuration.

I don't have any other vmargs in run configuration.


STS version:

Version: 3.9.7.RELEASE, Platform: Eclipse 2018-12 (4.10.0)

greg-449 :

The settings in the eclipse.ini / sts.ini file are only used by Eclipse/STS - they are not passed to programs you run from within Eclipse.

The settings for each program are separate and are configured in the 'Run > Run Configuration' for the program.

You can configure default VM arguments for a particular JRE in the Preferences on the 'Java > Installed JREs' page using the 'Edit...' button and editing the 'Default VM arguments' field.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=149412&siteId=1