今天在使用jetty:run运行maven项目时,接连出现了几次内存溢出的错误,原本以为代码有误,调试发现并无可修改之处,故请教我的前辈楠哥,终于将该问题消灭了,得来之经验与诸位同道分享,如有所悟,不胜荣幸!
1 调整了eclipse的工作内存 并加入 -clean 参数
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20150204-1316
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:PermSize=256M
-XX:MaxPermSize=2048M
-clean
注:其中下划线的部分为改动的地方
2 调整VM启动参数
在Edit configuration界面输入调整VM参数,或者新建 variables ,输入参数即可,参数内容如下:
a .
b.
c.
d.
e.
命令如下: