apache-tomcat-7.0.40 加大内存配置

环境:(win7)

64 位 apache-tomcat-7.0.40

 打开这个文件 apache-tomcat-7.0.37\bin\catalina.bat,

在 echo Using CATALINABASE: “%CATALINABASE%”的上面一行加下面代码:

set JAVA_OPTS=-Xms1024m -Xmx4096m -XX:PermSize=128m -XX:MaxPermSize=256m

加入后位置如下:

rem —– Execute The Requested Command —————————————

set JAVA_OPTS=-Xms1024m -Xmx4096m -XX:PermSize=128m -XX:MaxPermSize=256m

echo Using CATALINABASE: “%CATALINABASE%”

参数说明:

-Xms:初始 Heap 大小,使用的最小内存,cpu 性能高时此值应设的大一些

-Xmx:Java heap 最大值,使用的最大内存

上面两个值是分配 JVM 的最小和最大内存,取决于硬件物理内存的大小,建议均设为物理内存的一半。

-XX:PermSize:设定内存的永久保存区域

-XX:MaxPermSize:设定最大内存的永久保存区域

发布了306 篇原创文章 · 获赞 193 · 访问量 71万+
展开阅读全文

Tomcat8中如何内存溢出,如何增大内存

06-15

控制台报错: java.lang.OutOfMemoryError: PermGen space at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:883) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:773) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1324) at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:326) at org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:305) at org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.java:50) at org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:207) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:169) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 代码报错位置(字符串可以看到json串,但是执行报内存溢出): ![图片说明](https://img-ask.csdn.net/upload/201606/15/1465961492_415406.jpg) 我是在本地tomcat8下面跑的,按照网上所说,我修改了catalina.bat文件增大内存,可可是貌似没有生效(如截图所示,本地tomcat数值一直没变),求助 ![图片说明](https://img-ask.csdn.net/upload/201606/15/1465961473_564921.jpg) catalina.bat 第一行修改了set JAVA_OPTS=-Xms1024m -Xmx1024m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=2048m, :noJuliConfig set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%" JAVA_OPTS='-Xms512m -Xmx1024m' JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=512M -XX:MaxPermSize=2048m" 等等,没有用啊。。 分不多,都给你了,真心求教。(纯粹赋值张贴得别拿来了,我也上网搜了还没解决) 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览