Prev Next

Testing / Apache JMeter Interview questions

How can you optimize a test plan for lower memory use in a soak test?

Remove or disable memory-heavy listeners entirely from the test plan used for the actual soak run, especially View Results Tree, since these accumulate stored sample data over time and a long-duration soak test is exactly the scenario where that accumulation compounds into a serious memory problem rather than staying small.

Configure result-file writers to save only the specific fields actually needed for later analysis, rather than the full default set including response data, since storing complete response bodies for every sample across a many-hour soak test can produce enormous result files and proportional memory pressure while writing them.

Watch for unbounded variable growth in scripted elements (JSR223 Pre/Post-Processors) - a script that appends to a shared list or map without ever clearing it across thousands of iterations over a long soak test will leak memory within the JMeter process itself, independent of anything happening on the system under test.

Periodically restart long-running remote engines if a soak test is expected to run for many hours or days, since even a well-optimized test plan can accumulate some JVM-level memory fragmentation over very long uptimes, and a planned restart between test phases can be cheaper than troubleshooting a slow memory creep hours into an already-long run.

Increase the JVM heap allocated to JMeter appropriately for the expected sample volume, but treat this as a complement to the above practices, not a substitute for them, since a larger heap alone doesn't fix an actual memory leak in the test plan itself - it just delays when that leak becomes visible as an out-of-memory failure.

A common source of unbounded memory growth in scripted elements is:
Increasing JVM heap size should be treated as:

More Related questions...

What is Apache JMeter? What is a Test Plan in JMeter? What is a Thread Group in JMeter? What is a Sampler in JMeter? What are Listeners in JMeter? What is a Config Element in JMeter? What are Timers in JMeter? What are Assertions in JMeter? Define a Logic Controller in JMeter? What is the CSV Data Set Config element? What is the HTTP(S) Test Script Recorder? Describe the Aggregate Report listener? What is a Regular Expression Extractor? What is Non-GUI mode in JMeter? What are Pre-Processors and Post-Processors in JMeter? What is the Constant Timer? Describe the HTTP Cookie Manager? What is a JMeter Property? List the protocols JMeter supports for load testing? How do you record a test script in JMeter? What is the difference between a Sampler and a Controller in JMeter? How does the ramp-up period affect a JMeter test? Why should you avoid running load tests in GUI mode? What is the difference between Correlation and Parameterization? How does the CSV Data Set Config distribute data across threads? When should you use a Transaction Controller? What is the difference between JSR223 and BeanShell elements? How do JMeter Assertions differ from Post-Processors? What is the difference between Response Time and Latency in JMeter? Why is the View Results Tree listener discouraged during load runs? How does the Constant Throughput Timer control request rate? What is the difference between a Loop Controller and a While Controller? When should you use the If Controller versus a separate Thread Group? How do you pass command-line properties into a JMeter test? What is the difference between master-slave distributed testing and running tests locally? How does JMeter's Cache Manager simulate real browser behavior? What is the difference between load testing, stress testing, and spike testing? Why do you need to correlate dynamic values like session tokens? Explain the execution flow of a JMeter test plan with nested thread groups and controllers? How can you optimize JMeter for generating high load with limited hardware? How do you troubleshoot inconsistent response times across distributed JMeter load generators? Explain the internal working of JMeter's distributed (master-slave) testing architecture? How can you optimize a test plan for lower memory use in a soak test? Which is better for extracting dynamic values: Regular Expression Extractor or JSON Extractor, and why? How do you troubleshoot a JMeter test producing artificially low response times due to caching? Explain the lifecycle of a single HTTP sampler request through JMeter's processor chain? How can you optimize correlation for an application using rotating CSRF tokens? How do you troubleshoot a connection reset spike during scaled-up load? Explain the execution flow of generating an HTML dashboard report from a JTL results file? How can you optimize JMeter script maintainability for a large, growing regression suite?
Show more question and Answers...

API

Comments & Discussions