JMeter memory overflow solution

Click the link to join the QQ group 522720170 (free public classes, videos are available): https://jq.qq.com/?_wv=1027&k=5C08ATe

 

When using jmeter for the stress test, the outfmenmory error of memory overflow was reported after a period of time, which caused jmeter to freeze. First, try adding JVM_ARGS="-Xmx2048m -Xms2048m -Xmn256m -XX:PermSize=128m -Xss256k" to jmeter.bat , but the result is that the running time increases, but the memory overflow is reported in the end. After Baidu changed the following settings according to the suggestions of netizens, jmeter no longer stuck:

 

1. In the windows environment, modify jmeter.bat:

set HEAP=-Xms256m -Xmx256m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
Change it to:
set HEAP=-Xms256m -Xmx1024m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=512m
 
According to experience, the heap can be set to half of the physical memory at most, and the default setting is 512M. If the heap exceeds half of the physical memory, it may be slow to run jmeter, or even memory overflow, because java eats more memory and occupies CPU.
Note: The Xmx of a JDK32-bit computer cannot exceed 1500m, and the maximum is 1378m. Otherwise, an error will be reported when starting Jmeter:
2. In the linux environment, modify jmeter.sh:
java  $JVM_ARGS -Xms1G -Xmx5G -XX:MaxPermSize=512m -Dapple.laf.useScreenMenuBar=true -jar `dirname $0`/ApacheJMeter.jar "$@"
 
 
3. If you look at the number of bits of the JDK
# java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

If it is 64-bit, the last line will display 64-Bit
#java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324872320&siteId=291194637