内存不足的错误:Java堆空间在JMeter的未来
问题描述:
首先,我一跑的JMeter与Tomcat服务器8GB的虚拟机上的GUI和非GUI模式,但我得到了500个用户内存不足的错误:Java堆空间在JMeter的未来
Caused by: java.net.SocketExecption: Connection reset by peer: Socket write error
错误现在,我已经采取了Tomcat服务器16GB的专用系统,为400个用户在GUI模式下,我得到这个错误运行JMeter的:
Uncaught exception:java.lang.OutofmemoryError: Java heap space/ GC overhead limit exceeds even after changing the heap size in jmeter.sh file, jmeter.file and windows batch file
什么导致这个问题呢?
答
按Java Garbage Collection handbook
The java.lang.OutOfMemoryError: GC overhead limit exceeded error is the JVM’s way of signalling that your application spends too much time doing garbage collection with too little result. By default the JVM is configured to throw this error if it spends more than 98% of the total time doing GC and when after the GC only less than 2% of the heap is recovered
试试以下设置:
- 增加分配给JMeter的JVM堆是你的总可用物理内存
- 切换到CMS garbage collector的80%左右通过向JVM添加
-XX:+UseConcMarkSweepGC
参数 - 确保您遵循JMeter Best Practices和9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure指南
给Tomcat分配多少内存? –
500MB分配 – susmitha
而对于JMeter?对不起,我没有问在prevouse commet。 –