Reputation: 11
I am currently trying to understand how JMeter's Garbage collection affects the response time. According to my reference, I found that the time spent in GC will be added to the overall elapsed time. In my case, I have to either reduce or remove the time taken for GC. More preferably shorter GC pauses. while looking out for my issue. I have seen this article https://howtojboss.wordpress.com/2012/07/31/concurrent-high-throughput-performance-testing-with-jmeter/ Where they said the solution is to use Concurrent Mark Sweep (CMS) collector.
GC="-XX:+UseConcMarkSweepGC"
But that is not working for my case. I am getting the same elapsed time after using all the types of garbage collectors like serial, parallel, G1GC, ZGC, and Shenandoah GC. I have tried these modifications in the JMeter file on the line
set GC_ALGO = -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1 ReservePercent=20
But whatever the type of GC I use, I am getting the peak at the same time in my graph. For example, if I am testing with 50k records, in getting the peak at 3/4 (near 33k), similarly for 5k records getting the peak exactly near 3.3k. Have attached the sample graph here: please look at the example Graph. Please let me know if there are any other ways.
I am using JMeter version 5.4.1 and my system heap size is
Heap = -Xms8g -Xmx12g -XX:MaxMetaspaceSize=4g
If the time peaks in the graph are not due to garbage collection activity. Then what may be the reasons for those time peaks at the particular interval? Please let me know if there are any other reasons for those time peaks.
Upvotes: 0
Views: 1018
Reputation: 168122
I don't think response time peaks are connected with garbage collection, throughput might drop due to the pause while JVM is doing full GC but response times shouldn't change.
Try monitoring JMeter's GC activity using JConsole, JVisualVM or JMeter PerfMon Plugin and pay attention to other metrics like CPU, RAM, Swap usage, etc. and correlate the response time peaks with what's going on with JMeter load generator(s)
If you won't see anything suspicious - repeat the exercise at the system under test side.
Also make sure that you're following JMeter Best Practices and try out running JMeter in distributed mode
Upvotes: 0