Class unloading should be disabled by -XX:-ClassUnloading (or the equivalent -Xnoclassgc). However, G1 does not honor such requests correctly.
When G1 performs a full GC, it does not conditionalize the marking phase of root processing based on the ClassUnloading option. Instead it always marks the roots as if class unloading is enabled. Unfortunately, later code does attempt to honor ClassUnloading, with resulting problems.
When G1 performs a concurrent mark, it conditionalizes some of the work on the ClassUnloadingWithConcurrentMark option, which defaults to true. That feature is not disabled when ClassUnloading is requested disabled, so it is presently possible to have ClassUnloading false and ClassUnloadingWithConcurrentMark true. As a result, later processing that is disabled when ClassUnloading is disabled may go awry.