Class Unloading in Java's G1 Garbage Collector (G1GC)
The G1 performs the class unloading during a Full GC, so you do not need to specify any parameters to enable this.
You can see for yourself by using the -XX:+TraceClassUnloading
argument.
Also, check out this email thread from the HotSpot GC mailing list: Bug in G1GC it performs Full GC when code cache is full resulting in overkill. They discuss class unloading in G1 quite extensively. In summary, you can use -noclassgc
if you are seeing issues with class unloading but usually there are no problems with class unloading in G1.