tomcat java.lang.OutOfMemoryError

安装了64位 jdk7_17之后,tomcat 7 总是报内存溢出错误。

调整之后依然不起作用,不得已又换回32位JDK。

调整内存的配置:

export JAVA_OPTS="-server -Xmx1536M -XX:MaxPermSize=512m -Dfile.encoding=UTF-8"
保存为%TOMCAT_HOME%/bin/setenv.bat

参数说明:

-server

    Select the Java HotSpot Server VM.
    For more information, see Server-Class Machine Detection[http://docs.oracle.com/javase/1.5.0/docs/guide/vm/server-class.html]


-Xmxn
    Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. Examples:

               -Xmx83886080
               -Xmx81920k
               -Xmx80m
               
-XX:MaxPermSize=64m
    Size of the Permanent Generation.  [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.]

-Dproperty=value
    Set a system property value. If value is a string that contains spaces, you must enclose the string in double quotes:

                java -Dfoo="some string" SomeClass


参考资料:

[1] Artur Ejsmont. http://artur.ejsmont.org/blog/content/fixing-javalangoutofmemoryerror-permgen-out-of-memory-in-grails-sts-and-tomcat

[2] java - the Java application launcher. http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/java.html

[3] Java HotSpot VM Options. http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值