简体   繁体   English

增加PermGen空间(Tomcat7,Windows服务)

[英]Increase PermGen space (Tomcat7, Windows Service)

I'm running Tomcat7 as a service on a Windows 2008 Server and from time to time I get the "OutOfMemory Exception" due to the PermGen space. 我在Windows 2008 Server上运行Tomcat7作为服务,并且由于PermGen空间,我不时得到“OutOfMemory Exception”。

I read in another thread that using a setenv.bat doesnt work when running Tomcat as a service (because catalina.bat is not used, hope thats correct). 我在另一个线程中读到,当运行Tomcat作为服务时,使用setenv.bat不起作用(因为没有使用catalina.bat,希望这是正确的)。 I usually use the "Configure Tomcat" GUI to set the memory pool for Java (min, max), but there is not specific option for the Perm space as far as I can see. 我通常使用“配置Tomcat”GUI来设置Java的内存池(最小值,最大值),但据我所知,Perm空间没有特定的选项。

Can I set that value in the Java Options field of the GUI somehow? 我能以某种方式在GUI的Java Options字段中设置该值吗? Or how do I do that? 或者我该怎么做?

Regards Alex 关心亚历克斯

Yes you could set that in the jvm options field for example 是的,你可以在jvm选项字段中设置它

-XX:MaxPermSize=256m

For the case that your problem exists (but only comes up later) then you should profile your application for memory leaks. 对于您的问题存在的情况(但仅在稍后出现),您应该分析您的应用程序是否存在内存泄漏。

Seems like this is what you are looking for: 看起来这就是你要找的东西:

http://umpteenchoices.blogspot.com/2011/05/tomcat-7-windows-service-memory.html http://umpteenchoices.blogspot.com/2011/05/tomcat-7-windows-service-memory.html

As per the link: 根据链接:

To set the Permgen size, you need either -XX:PermSize=XXXm or -XX:MaxPermSize=XXXm. 要设置Permgen大小,您需要-XX:PermSize = XXXm或-XX:MaxPermSize = XXXm。 This can be set on the Java tab of the Monitor Tomcat GUI, this time as a Java Option. 这可以在Monitor Tomcat GUI的Java选项卡上设置,这次是作为Java选项。

在此输入图像描述

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

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