我正在使用以下命令下载大小为450MB的视频:
JVM_ARGS="-Xms1024m -Xmx4096m -XX:NewSize=512m -XX:MaxNewSize=512m
-XX:+UseConcMarkSweepGC" && export JVM_ARGS && ./jmeter.sh -n -t .../jmx_Tests.jmx -l jtlfilename.jtl
jmeter.bat
文件配置为:set HEAP=-Xms1g -Xmx4g -XX:MaxMetaspaceSize=512m
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3236) ~[?:1.8.0_181]
at org.apache.jmeter.protocol.http.util.DirectAccessByteArrayOutputStream.toByteArray(DirectAccessByteArrayOutputStream.java:43) ~[ApacheJMeter_http.jar:4.0 r1823414]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.toByteArray(HTTPSamplerBase.java:1872) ~[ApacheJMeter_http.jar:4.0 r1823414]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1852)
但是下载16个文件后出现内存不足异常。然后我更改为-Xmx5120m
,但仍然抛出相同的异常。
system details: 8 GB RAM
threads:50