简体   繁体   English

Eclipse:java.lang.OutOfMemoryError:PermGen空间

[英]Eclipse:java.lang.OutOfMemoryError: PermGen space

My eclipse configuration. 我的日食配置。

Eclipse : latest version (Kepler) Eclipse:最新版本(Kepler)

My eclipse config.ini 我的日食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. 更新后从到Juno到Kepler。但是使用相同的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$1.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; [ERROR]内存不足; 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. 谢谢你的帮助。

From Eclipse wiki - Eclipse Wiki-

Why am I getting a java.lang.OutOfMemoryError: PermGen space? 为什么会出现java.lang.OutOfMemoryError:PermGen空间?

The default maximum Permanent Generation space set by your JRE may be too small. JRE设置的默认最大永久生成空间可能太小。 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 您可以通过使用VM参数启动Eclipse来增加PermGen的最大大小:-XX:MaxPermSize = 128m

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. 希望它将解决问题。

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. 此问题也可能是由于当您以Eclipse Run As ... Run on Server时,启动列表中的应用程序过多。

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 . 如果您除了要启动的应用程序之外还看到其他应用程序,只需删除所有不需要的应用程序,以便仅选择您的应用程序,然后单击Finish This will require much less memory and thus not require you to jack up the PermGen space. 这将需要更少的内存,因此不需要您占用PermGen空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM