专治jdk8堆外内存去哪了

时间:2022-02-10 15:09:43

centos6.5 64bit


1、确保jdk8+tomat8 

jdk8+tomcat7绝对会GG

2、 堆外内存参数配置
-XX:InitialCodeCacheSize=64M \
-XX:CodeCacheExpansionSize=1M \
-XX:CodeCacheMinimumFreeSpace=1M \
-XX:ReservedCodeCacheSize=200M \
-XX:MinMetaspaceExpansion=1M \
-XX:MaxMetaspaceExpansion=8M \
-XX:MaxDirectMemorySize=96M \
-XX:CompressedClassSpaceSize=256M \


3、线程分配虚拟内存调优
/etc/profile追加一行:
export MALLOC_ARENA_MAX=1

source /etc/profile


 每天重启下服务器,在加上这一坨东西 ,不管白天和黑夜稳如狗