JMeter FAQ
This section compiles common questions and solutions when using Apache JMeter.
Installation Issues
Q1: Running JMeter shows "java" is not recognized as an internal or external command
A: Ensure Java is properly installed and configured. Verify in command line:
java -version
If not installed, download and install Java JDK 8 or higher. For Windows, also set JAVA_HOME environment variable.
Q2: JMeter interface shows garbled characters
A: This is caused by font encoding issues. Solution:
- Open bin/jmeter.properties file
- Add or modify:
sampleresult.default.encoding=UTF-8 - Restart JMeter
Q3: JMeter runs out of memory and crashes
A: Default heap size may be insufficient. Adjust:
- Windows: Edit bin/jmeter.bat, find set HEAP parameter and increase
- Linux/Mac: Edit bin/jmeter, adjust HEAP variable Recommended 2GB or higher:
HEAP="-Xms2g -Xmx2g"
Test Execution Issues
Q4: How to simulate multiple different user logins?
A: Use parameterization:
- Create CSV file with usernames and passwords
- Add "CSV Data Set Config" element
- Use ${username} and ${password} variables in HTTP requests
Q5: JMeter cannot extract Session or Cookie
A: Ensure appropriate elements are added:
- Add "HTTP Cookie Manager" to thread group
- For tests requiring login, ensure "Clear cookies each iteration" is properly configured
- Check if requests correctly carry Cookies
Q6: Chinese characters in response data display as garbled
A: Solutions:
- Add or modify "Content Encoding" to UTF-8 in HTTP Request
- Set default encoding in "HTTP Request Defaults"
- Use "Regular Expression Extractor" in post-processor and specify encoding
Q7: How to handle HTTPS certificate issues?
A: For test environments:
- Import trusted certificates into Java cacerts store
- Or set "Implementation" to Java in HTTP Request
- For self-signed certificates, may need to import JMeter's truststore
Q8: Memory keeps growing during long test runs
A: Recommended measures:
- Reduce data collected by listeners
- Run tests in command-line mode
- Increase garbage collection frequency in jmeter.properties:
mode=Stripped - Clean result files regularly
Performance Issues
Q9: JMeter cannot generate enough load
A: Try these methods:
- Use distributed testing (remote testing)
- Adjust thread count and loop count
- Reduce unnecessary listeners
- Use command-line mode instead of GUI mode
- Check if network bandwidth is the bottleneck
Q10: Response time fluctuates greatly in test results
A: Possible causes and solutions:
- Server-side GC or caching issues
- Unstable network
- Test data has dependencies
- Use Synchronizing Timer to ensure concurrent requests
- Increase warm-up time, let server stabilize before collecting statistics
Q11: How to set reasonable concurrency?
A: Recommended approach:
- Start with lower concurrency (10-50)
- Gradually increase concurrency and observe system response
- Find the performance inflection point (response time starts increasing)
- Determine maximum safe concurrency
- Perform stress testing to verify system limits
Reporting and Results Analysis
Q12: How to generate HTML reports?
A: Use command line:
jmeter -n -t test_plan.jmx -l results.jtl -e -o /path/to/report
Or generate from existing results file:
jmeter -g results.jtl -o /path/to/report
Q13: What do the metrics in Aggregate Report mean?
- Samples: Total number of requests
- Average: Average response time in milliseconds
- Median: Median response time
- 90%/95%/99% Percentile: 90%/95%/99% of requests respond faster than this value
- Min/Max: Minimum and maximum response time
- Error %: Percentage of failed requests
- Throughput: Number of requests processed per second
Q14: Result file is too large
A: Solutions:
- Save as CSV format in listeners
- Configure to save only necessary fields
- Use "Distributed Testing" to distribute storage
- Rotate result files regularly
Scripting Issues
Q15: How to handle dynamically changing parameters?
A: Common methods:
- Use "Regular Expression Extractor" to extract from response
- Use "JSON Extractor" to extract JSON data
- Use "CSS/JQuery Extractor" to extract HTML elements
- Use "XPath Extractor" to extract XML data
Q16: BeanShell scripts cannot run
A: Ensure:
- JDK is properly installed (not JRE)
- BeanShell library files are in lib directory
- Check script syntax is correct
Q17: How to implement complex business logic?
A: Can use:
- Logic Controller combinations
- BeanShell or JSR223 scripts
- Pre/Post processors
- Throughput Controller for conditional execution
Other Issues
Q18: What is the difference between JMeter and browsers?
JMeter works at protocol level, it is not a browser:
- Does not execute JavaScript
- Does not render HTML pages
- Does not handle CSS
- Cannot simulate all browser behaviors
Q19: How to learn JMeter?
Recommended learning path:
- Read JMeter's official user manual
- Start with simple HTTP requests
- Learn parameterization and correlation
- Master distributed testing
- Learn custom script development
Q20: What operating systems does JMeter support?
JMeter is a pure Java application and supports any OS with Java installed, including Windows, Linux, Mac OSX, Solaris, and more.
