-1

In my JMeter test I find that JMeter keep loading classes javascript_gen_cmd__xxx and it makes the test can't reach the throughput I set.

Class loading from JConsole When I click "Perform GC" button in JVisualVM, the classes are unloaded and the throughput is reached.

So i think it would help if I could indicate when the GC should happen, for example when the total number of loaded class reach certain number.

I tried -XX:MetaspaceSize=120M but it didn't trigger class unload when the metaspace usage reached 120MB.

user1532146
  • 184
  • 2
  • 14
  • I think it is a different problem because that one is about custom class loader but this one is more about how to set the metaspace parameter so that the unloading process can be controlled. – user1532146 Sep 06 '16 at 20:51
  • The real issue here is the use of the Mozilla JS codegen that keeps creating classes over and over. It's most unlikely that _more_ GC will really solve a problem here. – bmargulies Sep 07 '16 at 18:22

1 Answers1

0

Something like -XX:MaxMetaspaceFreeRatio=30 -XX:MinMetaspaceFreeRatio=10 should cause it to fill up quickly and thus trigger class-unloading GCs.

Alternatively -XX:+ExplicitGCInvokesConcurrent -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses and using CMS or G1 and firing System.gc() via a timer might work too.

the8472
  • 40,999
  • 5
  • 70
  • 122