2017-08-03 108 views

回答

0

它在getting started手冊:

環境變量JVM_ARGS可用於在jmeter.bat腳本來覆蓋JVM設置。例如:

set JVM_ARGS="-Xms1024m -Xmx1024m -Dpropname=propvalue" 
jmeter -t test.jmx … 
+0

嗨,只是想清楚了一些懷疑。需要在環境變量中設置JVM_ARGS = -Xms1024m -Xmx1024m -Dpropname = propvalue,並用jmeter.bat -n -t「script.jmx」以非gui形式執行腳本。我的理解是正確的。提前致謝 –

+0

是的, jmeter將JVM_ARGS變量添加到執行中 – user7294900

+0

我必須執行許多具有不同堆大小的腳本您能否建議我如何動態處理它?是否直接從命令提示符處執行? –

0
update your jmeter.sh file as below 
java -server $JVM_ARGS -jar `dirname $0`/ApacheJMeter.jar "[email protected]" 

your executable".sh"(which has all information about jmeter home, script name which needs to be executed) should be as follows---- 
#!/bin/sh 
JVM_ARGS="-Xms2g -Xmx2g" 
JMETER_HOME=/tui/endeca/endeca/ToolsAndFrameworks/jmeter/app/apache-jmeter-3.1/ 
export JVM_ARGS 
export JAVA_HOME 
echo $JAVA_HOME 
echo $JVM_ARGS 
#export JMETER_HOME 
$JMETER_HOME/bin/jmeter.sh -n -t "/tui/endeca/endeca/ToolsAndFrameworks/Script/TH/script.jmx" 

To see the updated heap use the below in JSR223 Sampler(Thanks to Dmitri for solution) 
import java.lang.management.ManagementFactory 
import java.lang.management.RuntimeMXBean 
def runtimeMxBean = ManagementFactory.getRuntimeMXBean() 
def arguments = runtimeMxBean.getInputArguments() 
for (argument in arguments) { 
    println('Effective JVM argument: ' + argument) 
} 
相關問題