Eclipse:java.lang.OutOfMemoryError: PermGen space
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18331641/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse:java.lang.OutOfMemoryError: PermGen space
提问by Suresh Atta
My eclipse configuration.
我的日食配置。
Eclipse : latest version (Kepler)
Eclipse:最新版本(开普勒)
My eclipse config.ini
我的eclipse config.ini
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20130521-0416
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40M
-Xmx512M
After Updation From to Juno to Kepler.But with the same configuration
I did'nt face any issue.
更新后从朱诺到开普勒。但同样configuration
我没有遇到任何问题。
Exception I'm facing is
我面临的例外是
Caused by: java.lang.OutOfMemoryError: PermGen space
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
at sun.reflect.MethodAccessorGenerator.run(MethodAccessorGenerator.java:381)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
at sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:28)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.sf.beanlib.provider.BeanPopulator.invokeMethodAsPrivileged(BeanPopulator.java:221)
at net.sf.beanlib.provider.BeanPopulator.doit(BeanPopulator.java:194)
at net.sf.beanlib.provider.BeanPopulator.processSetterMethod(BeanPopulator.java:172)
at net.sf.beanlib.provider.BeanPopulator.populate(BeanPopulator.java:270)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.populateBean(ReplicatorTemplate.java:174)
at net.sf.beanlib.provider.replicator.BeanReplicator.replicateBean(BeanReplicator.java:173)
at net.sf.beanlib.hibernate3.Hibernate3JavaBeanReplicator.replicateBean(Hibernate3JavaBeanReplicator.java:71)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicateByBeanReplicatable(ReplicatorTemplate.java:125)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicate(ReplicatorTemplate.java:120)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicate(ReplicatorTemplate.java:67)
at net.sf.beanlib.hibernate3.Hibernate3CollectionReplicator.replicate(Hibernate3CollectionReplicator.java:143)
at net.sf.beanlib.provider.replicator.CollectionReplicator.replicateCollection(CollectionReplicator.java:88)
at net.sf.beanlib.hibernate3.Hibernate3CollectionReplicator.replicateCollection(Hibernate3CollectionReplicator.java:79)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicate(ReplicatorTemplate.java:101)
at net.sf.beanlib.provider.BeanTransformer.transform(BeanTransformer.java:224)
at net.sf.beanlib.provider.BeanPopulator.doit(BeanPopulator.java:201)
at net.sf.beanlib.provider.BeanPopulator.processSetterMethod(BeanPopulator.java:172)
at net.sf.beanlib.provider.BeanPopulator.populate(BeanPopulator.java:270)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.populateBean(ReplicatorTemplate.java:174)
at net.sf.beanlib.provider.replicator.BeanReplicator.replicateBean(BeanReplicator.java:173)
at net.sf.beanlib.hibernate3.Hibernate3JavaBeanReplicator.replicateBean(Hibernate3JavaBeanReplicator.java:71)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicateByBeanReplicatable(ReplicatorTemplate.java:125)
at net.sf.beanlib.provider.replicator.ReplicatorTemplate.replicate(ReplicatorTemplate.java:120)
[ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)
It's keep telling me
它一直在告诉我
[ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)
[错误] 内存不足;要增加内存量,请在启动时使用 -Xmx 标志(java -Xmx128M ...)
Here is my VM args
这是我的 VM 参数
What could be the issue..
可能是什么问题..
Thanks for any help.
谢谢你的帮助。
采纳答案by Andrew Martin
From Eclipse wiki-
来自Eclipse 维基-
Why am I getting a java.lang.OutOfMemoryError: PermGen space?
The default maximum Permanent Generation space set by your JRE may be too small. This is unrelated to the maximum allowed Heap space. You can increase the maximum PermGen size by launching Eclipse with the VM argument: -XX:MaxPermSize=128m
为什么会出现 java.lang.OutOfMemoryError: PermGen space?
您的 JRE 设置的默认最大永久代空间可能太小。这与允许的最大堆空间无关。您可以通过使用 VM 参数启动 Eclipse 来增加最大 PermGen 大小:-XX:MaxPermSize=128m
回答by user2689075
Increase -vmargs to 512 & 1024 in eclipse.ini & close the eclipse & open it again.
在 eclipse.ini 中将 -vmargs 增加到 512 和 1024 并关闭 eclipse 并再次打开它。
Hopefully it will solve the issue.
希望它能解决问题。
回答by CodeMed
This problem might also be due to there being too many apps in the launch list when you Run As ... Run on Server
in eclipse.
此问题也可能是由于您Run As ... Run on Server
在 Eclipse 中启动列表中的应用程序过多。
To find out of this is the cause of the problem, you can just click Next
to see the list of apps that will be launched, instead of rushing through to click Finish
.
要找出这是问题的原因,您只需单击Next
即可查看将启动的应用程序列表,而不必急于单击Finish
。
If you see other apps besides the one you want to launch, just remove all the unwanted apps so that only your app is selected, and then click Finish
. This will require much less memory and thus not require you to Hyman up the PermGen space.
如果您看到除要启动的应用程序之外的其他应用程序,只需删除所有不需要的应用程序,以便仅选择您的应用程序,然后单击Finish
。这将需要更少的内存,因此不需要您增加永久代空间。