1

I want to change the heap size of jmeter at run time. Can you kindly suggest how I can achieve it

I used the below command, but looks like whatever heap I'm setting not effective.

I used:

Runtime.getRuntime().maxMemory(); 

to check the alloacted memory and it returned

9544663040

Looks like I am doing something wrong.

JVM_ARGS="-Xms2g -Xmx6g" /tui/endeca/endeca/ToolsAndFrameworks/jmeter/app/apache-jmeter-3.1/bin/jmeter.sh -n -t /tui/endeca/endeca/ToolsAndFrameworks/Script/TH/TH_BitBucket_Augu3_Lg.jmx

Thank you in advance

Goerman
  • 163
  • 7
  • 18
Sylvia Lobo
  • 317
  • 2
  • 5
  • 12
  • Possible duplicate of [Setting JVM heap size at runtime](https://stackoverflow.com/questions/763295/setting-jvm-heap-size-at-runtime) – Ori Marko Aug 07 '17 at 07:53

1 Answers1

1

I don't think your way of checking maximum heap is correct, I believe you should be using JMX to check effective parameters, in particular MemoryPoolMXBean

Quick way to check whether your argument got applied or not is the following Groovy code (use it in any of JSR223 Test Elements)

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)
}

Demo:

JMeter Heap Check

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Big Thank you Dmitri:). I can check the heap now:) – Sylvia Lobo Aug 07 '17 at 09:18
  • 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 update in jmeter.sh file as java -server $JVM_ARGS -jar `dirname $0`/ApacheJMeter.jar "$@" #export JMETER_HOME $JMETER_HOME/bin/jmeter.sh -n -t "/tui/endeca/endeca/ToolsAndFrameworks/Script/TH/TH_BitBucket_Augu3_Lg.jmx" – Sylvia Lobo Aug 18 '17 at 09:18