I have a question about ClassUnloadingWithConcurrentMark flag since I didn't find any useful help anywhere. If we use G1GC is set to true by default (-XX:+ClassUnloadingWithConcurrentMark). If I use -XX:-ClassUnloadingWithConcurrentMark flag to turn off class unloading after G1 concurrent mark where is class unloading executed then (which phase)? I read somewhere that it happens when full GC is activated by what if full GC is never triggered? I have problems with long remark phases - unloading in below example took more than 3 seconds:
2015-06-08T08:09:16.318+0200: 572818.729: [GC remark 572818.729: [Finalize Marking, 0.0002590 secs] 572818.729: [GC ref-proc, 0.4479462 secs] 572819.177: [Unloading, 3.2004912 secs], 3.6499382 secs]
[Times: user=0.20 sys=0.08, real=3.64 secs]
Would using -XX:-ClassUnloadingWithConcurrentMark be useful to me to reduce class unloading times? I'm afraid that If I'll use this option I'll have even more problems (for example outofmemory exceptions,...) if class unloading will never happen.
EDIT: if we are using -XX:+ClassUnloadingWithConcurrentMark (default option) is class unloading triggered every time GC remark phase occurs? In logs I have some GC with GC cause: Metadata GC Threshold, but others don't have this cause but Unloading still happens in remark phase. Why is that so?