Grails(25)Grails Memory/Thread Issue Checking

本文介绍Grails框架中解决内存溢出问题的方法,包括JVM参数配置以适应JDK1.6,以及多线程池的合理设置。此外还介绍了如何通过配置远程JMX来监控Tomcat应用服务器。
Grails(25)Grails Memory/Thread Issue Checking

1. JDK Config
It is said that the grails will auto create classes and out of memory the PermSize.

It is said that we need to to config there to make jdk 1.6 working.
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

2. Multi Thread
executorService = new ThreadPoolExecutor(
PUSH_THREAD_POOL_SIZE, // core thread pool size
PUSH_THREAD_POOL_SIZE, // maximum thread pool size
10, // time to wait before resizing pool
TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(),
new ThreadPoolExecutor.DiscardPolicy());
LinkedBlockingQueue is with no size, so we can hold as much task as we can.

3. Connection Remote JMX Tomcat
http://www.mkyong.com/tomcat/jconsole-jmx-remote-access-on-tomcat/

Configurations
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port={port to access}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname={optional, allow what ip to access this Tomcat}

Not working throw proxy.

References:
JDK Config
http://docs.oracle.com/cd/E13209_01/wlcp/wlss30/configwlss/jvmgc.html
http://stackoverflow.com/questions/3334911/what-does-jvm-flag-cmsclassunloadingenabled-actually-do
http://stackoverflow.com/questions/3717937/cmspermgensweepingenabled-vs-cmsclassunloadingenabled/3720052#3720052
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值