Eclipse与java.lang.OutOfMemoryError:PermGen空间崩溃

时间:2015-06-29 09:05:50

标签: java eclipse out-of-memory tomcat6

生成的错误是

java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:183)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:576)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:546)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:477)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:465)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:445)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:381)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:457)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.wst.jsdt.ui.actions.RenameAction.<init>(RenameAction.java:57)
at org.eclipse.wst.jsdt.ui.actions.RefactorActionGroup.<init>(RefactorActionGroup.java:350)
at org.eclipse.wst.jsdt.ui.actions.RefactorActionGroup.<init>(RefactorActionGroup.java:197)
at org.eclipse.wst.jsdt.internal.ui.navigator.JavaNavigatorRefactorActionProvider.init(JavaNavigatorRefactorActionProvider.java:58)
at org.eclipse.ui.navigator.NavigatorActionService.initialize(NavigatorActionService.java:371)
at org.eclipse.ui.navigator.NavigatorActionService.getActionProviderInstance(NavigatorActionService.java:355)
at org.eclipse.ui.navigator.NavigatorActionService.fillActionBars(NavigatorActionService.java:253)
at org.eclipse.ui.navigator.CommonNavigatorManager.selectionChanged(CommonNavigatorManager.java:239)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2132)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1160)
at org.eclipse.ui.navigator.CommonViewer.handleSelect(CommonViewer.java:483)  

eclipse.ini的内容

 -startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize=512M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m -startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize=512M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m 

我找到了一些关于此错误的解决方案并相应地实现了它。

https://stackoverflow.com/a/16810832/5031486

https://stackoverflow.com/a/88262/5031486

在实现上面链接中提供的解决方案后,我仍然遇到此错误,Eclipse仍然崩溃。

我正在使用Eclipse Galileo,JDK 1.7,Apache tomcat 6.0。

在eclipse.ini文件中进行的更改

    -Xms40m -Xmx512m  -XX:MaxPermSize=512m

以前的值是

    -Xms40m -Xmx128m  -XX:MaxPermSize=128m 

我做了以上修改。但我仍有同样的问题 任何人都可以帮助我。

1 个答案:

答案 0 :(得分:1)

你的eclipse.ini是各种各样的复制混乱。尝试类似:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m