打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Solving Tomcat OutOfMemoryError: Heap space a...
It’s quite common to run In memory problems when running some big Java EE application on a Tomcat server.
Some of the most commmon errors are like the following ones.
This is about a full Heap space:
SEVERE: Servlet.service() for servlet jsp threw exceptionjava.lang.OutOfMemoryError: Java heap space
This other is about the PermGen space that’s a memory area, where compiled classes (and JSPs) are kept, and this error might happen often if the running web application have many .java and .jsp.
MemoryError: PermGen spacejava.lang.OutOfMemoryError: PermGen space
To increase the memory available to Tomcat, about heap and permgen the correct options are the following ones.
This sets the max heap available to Tomcat at 1Gb of memory:
--JvmMx 1024
This sets the max permgen available to Tomcat at 256Mb of memory:
-XX:MaxPermSize=256m
To change the Tomcat memory settings (when Tomcat is installed on Windows as system service), it’s required to use the command-line tool tomcat6. The next command changes the memory settings for the Tomcat service named Tomcat6
tomcat6 //US//Tomcat6 --JvmMx 1024 ++JvmOptions="-XX:MaxPermSize=256m"
The label //US//Tomcat6 has the meaning of Updating Server parameters for the service named Tomcat6.
Obviously this command should be executed from the directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin or from wherever is the bin directory of your Tomcat installation. Or to make things simple, that directoy should be added to your PATH environment variable.
It’s even possible to update memory settings from a GUI frontend, or to view what happened after running the command line tool. Running the following command:
tomcat6w //ES//Tomcat6
a window will open showing all the parameters about the windows service Tomcat6.
It’s possible to see in this image that, after running the previous command, for setting higher memory limits, in the sections Maximum memory pool and at the end of the Java Options the new memory limits are set.
Tomcat Memory Settings on Windows
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
TOMCAT内存大小调整
java.lang.OutOfMemory及其解决方法
tomcat的OutOfMemoryError解决方法
关于:java.lang.OutOfMemoryError
Tomcat内存溢出的原因
tomcat内存溢出总结--也不单单是Tomcat而言
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服