The code cache can be occupied by vtable stubs on SPARC.
Since the vtable stubs are not deallocated[1], and not shared/reused in Solaris[2],
it could get increased continuously and memory leaking is not negligible.
One of the potential scenarios are continuous creation of class loaders.
It causes excessive allocation and deallocation of nmethods. If call patterns are megamorphic, those nmethods will allocate corresponding vtable stubs for megamorphic inline cache transitions. While the nmethods are recycled, their vtable stubs are not
It is reproducible in the JDK 14 and 11.
[1] https://java.se.oracle.com/source/xref/jdk8u-cpu/hotspot/src/share/vm/code/vtableStubs.hpp#106
[2] https://java.se.oracle.com/source/xref/jdk8u-cpu/hotspot/src/cpu/sparc/vm/globals_sparc.hpp#41