java.lang.OutOfMemoryError:Jetty的PermGen空间错误 [英] java.lang.OutOfMemoryError: PermGen space error with Jetty

查看:278
本文介绍了java.lang.OutOfMemoryError:Jetty的PermGen空间错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在获取 java.lang.OutOfMemoryError:PermGen space 。我正在使用Jetty和Linux Ubuntu。我曾尝试阅读和尝试以前类似问题中提供的不同解决方案,但我没有取得任何成功。一个类似的问题是

I am currently getting an java.lang.OutOfMemoryError: PermGen space. I am using Jetty and Linux Ubuntu. I have tried reading and attempting the different solutions that were provided in previous similar questions but I am not having any success. One similar question was

处理java.lang.OutOfMemoryError:PermGen space错误

但这些解决方案似乎是使用Tomcat而不是Jetty 。如果我重新部署我的服务几次,我会不断出现记忆错误。例如,为了测试这个,我将转到我的webapps文件夹并运行touch * .xml来更新时间戳,然后重新运行jetty,我得到了内存不足错误。在我的jetty文件夹(包含bin,doc等,lib,日志,模块,start.jar)中我正在运行

But these solutions seem to be using Tomcat instead of Jetty. I keep getting the out of memeory error if I redeploy my service a few times. For example to test this I am going to my webapps folder and running touch *.xml to update the time stamp then re-run jetty and I get the out of memory error. In my jetty folder (the one that includes bin, doc, etc, lib, logs, modules, start.jar) I am running

java -jar ../start.jar

但是这给了我错误。然后我尝试了我在其他示例中读到的内容,例如:

But this gives me the error. I then tried what I read in the other examples such as:

java -jar ../start.jar JAVA_OPTS="-Xms256m -Xmx512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

-XX:MaxPermSize=128m

然后当我去firefox并导航到 localhost:8080 并刷新时,我保留了终端得到错误

Then when I go to firefox and navigate to localhost:8080 and refresh, in the terminal I keep getting the error

java.lang.OutOfMemoryError: PermGen space


推荐答案

希望你能够通过使用我的 ClassLoader泄漏防护库。在您自己的代码和第三方库中,存在许多可能导致这类内存泄漏的错误。有关该问题的更多信息,如何追踪它和已知违法者,可以在我的这个博客系列。请特别注意Jetty本身的此错误,这可能会导致这些类型的泄漏一些版本。

Hopefully you'll be able to get rid of these problems simply by using my ClassLoader Leak Prevention library. There are a lot of different mistakes that can cause these kinds of memory leaks, both in your own code and in third party libraries. More information about the problem, how to track it down and known offenders, can be found in this blog series of mine. Specifically note this bug in Jetty itself that may cause these kinds of leaks for some versions.

这篇关于java.lang.OutOfMemoryError:Jetty的PermGen空间错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆