分类: 系统运维
2014-05-14 13:57:13
java.lang.OutOfMemoryError: GC overhead limit exceeded解决方案
问题背景:
用Tsung做压力测试,当tcp连接数达到16万5千时,服务器卡住,且出错信息为:
{ERROR} [2014-05-09 14:58:45,077]
Exception in thread "pool-1-thread-82" java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception in thread "pool-1-thread-73" java.lang.OutOfMemoryError: GC overhead limit exceeded
解决方案:
增大JVM的内存量-Xmx,具体添加在run.sh中:
[root@tixaapp1 bin]# cat run.sh
#!/bin/sh
export BASEDIR=..
export CLASSPATH=$BASEDIR/conf
nohup java -Xmx4096m -server -classpath $CLASSPATH -Dbase.dir=$BASEDIR -jar $BASEDIR/lib/starter.jar > $BASEDIR/logs/nohup.out &
tail -f $BASEDIR/logs/nohup.out