Currently I have 6000 request per minute using 200 thread setup on my Jmeter configuration, first few hours everything looks good until it starts to drop the # of request and I noticed the memory/garbage collection start to pileup or reach to limit I set which is 24GB. is there's a way I could force reset the garbage collection so my request will be back at 6000 request per minute? This is hosted on AWS Cloud and I'm running my performance test. Your response is highly appreciated. Thank you.
I tried to run this command
-jmap -histo:live 13510
-jcmd 13510 GC.run
but it seems the number of my request on Jmeter is not reverted back to 6000.
Expected Result: I want my Jmeter request to revert back to 6000 request per minute.
Screenshot:
I think 24 GB of heap is too much for 200 threads. And 6 GB of MaxMetaspaceSize is definitely too much.
As per Optimal Heap Size chapter:
"If the occupancy of the Java heap is too high, garbage collection occurs frequently. If the occupancy is low, garbage collection is infrequent but lasts longer... Try to keep the memory occupancy of the Java heap between 40% and 70% of the Java heap size... The highest point of occupancy of the Java heap is preferably not above 70% of the maximum heap size, and the average occupancy is between 40% and 70% occupancy. If the occupancy goes over 70%, resize the Java heap."
"A correctly sized Java heap should always have a memory occupancy of between 40% and 70% of the maximum Java heap size. To ensure that the occupancy does not exceed 70%, set the maximum Java heap size to at least 43% larger than the Maximum occupancy value provided by GCMV. This setting then makes the Maximum value 70% of the Java heap and the average to be above 40% of the Java heap size."
So I would recommend reducing minimum heap size to default value of 1GB and do the same for the MaxMetaspaceSize and it should resolve your issue.
If the nature of your test assumes high heap usage and you cannot allocate less and still looking for the way of forcing the garbage collection it can be done using a suitable JSR223 Test Element and the following Groovy code:
System.gc()
However get familiarized with Guide to System.gc() article beforehand.