6

I am trying to increase heap size (memory) for the spring tool suite as I am getting out of memory.

If I increase from Xmx from 768m to 1024m I get the error "Failed to Create Java Virtual Machine".

If I revert Xmx to 768m it works fine but I get OOM (Out of Memory). I have STS 2.9.2. OS is win7.

This is currently what I have in sts.ini at the moment.

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
com.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
384M
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms256m
-Xmx1024m
-Xss1m
-XX:PermSize=256m
-XX:MaxPermSize=1024m

what should I change? Please advise.

4

1 回答 1

3
-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-
1740
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xmx1024m

您应该只更改 Xmx。这里我使用 Xmx1024m 表示 STS 分配有 1 GB 内存,而 Xmx4G 表示 4 GB 内存。您可以检查堆状态为

在 Windows 菜单中打开 sts 选择首选项,然后从常规选项卡标记显示堆状态选项。

于 2017-04-18T19:23:36.407 回答