一、jmeter.bat中jvm调优设置
rem =====================================================
rem Environment variables that can be defined externally:
rem
rem Do not set the variables in this script. Instead put them into a script
rem setenv.bat in JMETER_HOME/bin to keep your customizations separate.
rem
rem DDRAW - (Optional) JVM options to influence usage of direct draw,
rem e.g. '-Dsun.java2d.ddscale=true'
rem
rem JMETER_BIN - JMeter bin directory (must end in )
rem
rem JMETER_COMPLETE_ARGS - if set indicates that JVM_ARGS is to be used exclusively instead
rem of adding other options like HEAP or GC_ALGO
rem
rem JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
rem
rem JM_LAUNCH - java.exe (default) or javaw.exe
rem
rem JM_START - set this to "start" to launch JMeter in a separate window
rem this is used by the jmeterw.cmd script.
rem
rem JVM_ARGS - (Optional) Java options used when starting JMeter, e.g. -Dprop=val
rem Defaults to '-Duser.language="en" -Duser.region="EN"'
rem
rem GC_ALGO - (Optional) JVM garbage collector options
rem Defaults to '-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20'
rem
rem HEAP - (Optional) JVM memory settings used when starting JMeter
rem Defaults to '-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m'
rem
rem =====================================================
#根据经验,堆值(HEAP)最多设置为物理内存的一半,如果堆值(HEAP)超过物理内存的一半,jmeter运行速度会变慢,甚至会出现内存溢出错误。