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
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
本文介绍Grails框架中解决内存溢出问题的方法,包括JVM参数配置以适应JDK1.6,以及多线程池的合理设置。此外还介绍了如何通过配置远程JMX来监控Tomcat应用服务器。
3731

被折叠的 条评论
为什么被折叠?



