我如何正确设置permgen大小? [英] How do I properly set the permgen size?

查看:1159
本文介绍了我如何正确设置permgen大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个虚拟机,里面有tomcat,java和grails。

  set JAVA_OPTS = -  Xms256m -Xmx1024m -XX我已经收到了permgen错误,所以我四处张望,发现了解决方案: :PermSize = 512m -XX:MaxPermSize = 512m

我使用SSH访问虚拟机并键入上面的论点。我想这会解决这个问题。事情是,我想确保我做得正确。所以我再次搜索了如何检查当前permSize,这是我得到的解决方案:

pre $ j $ $ $ jinfo -flag MaxPermSize 6444

6444是pid,作为回应,我得到了这个。

  -XX:MaxPermSize = 85983232 

问:maxPermSize的值是以字节为单位的吗?因为如果是这样,那就意味着java_opts命令不起作用。我期望得到512米,但85983232字节= 82 MB ..或者我看到它错了..?任何人都可以启发我吗? D:您必须更改Tomcat Catalina start中定义的 CATALINA_OPTS 选项中的值文件。要增加 PermGen 内存,请更改 MaxPermSize 变量的值,否则更改 Xmx 变量。

Linux& Mac OS:打开或创建放置在bin目录中的 setenv.sh 文件。您必须将更改应用于以下行:

  export CATALINA_OPTS =$ CATALINA_OPTS -server -Xms256m -Xmx1024m -XX:PermSize = 512m -XX:MaxPermSize = 512m

Windows:



打开或创建位于bin目录中的 setenv.bat 文件:

  set CATALINA_OPTS = -server -Xms256m -Xmx1024m -XX:PermSize = 512m -XX:MaxPermSize = 512m 


I have this VM with tomcat, java, and grails in it. I've been getting permgen errors so I looked around and found the solution:

set JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"

I use SSH to access the vm and type the arguments above. I suppose that would fix the problem. Thing is, I wanted to make sure that I did it correctly. So I searched again on how I could check the current permSize and this is the solution I got:

jinfo -flag MaxPermSize 6444

6444 is the pid, and as a response, I got this.

-XX:MaxPermSize=85983232

Question: Is the value of the maxPermSize in bytes? because, if it is, then that would mean that the java_opts command didn't work. I am expecting to get 512m but 85983232 bytes = 82 mb.. Or am I seeing it wrong..? Can anybody enlighten me on this? D:

解决方案

You have to change the values in the CATALINA_OPTS option defined in the Tomcat Catalina start file. To increase the PermGen memory change the value of the MaxPermSize variable, otherwise change the value of the Xmx variable.

Linux & Mac OS: Open or create setenv.sh file placed in the "bin" directory. You have to apply the changes to this line:

export CATALINA_OPTS="$CATALINA_OPTS -server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"

Windows:

Open or create the setenv.bat file placed in the "bin" directory:

set CATALINA_OPTS=-server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m

这篇关于我如何正确设置permgen大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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