Certain parts in the hotspot indicate that they expect Metaspace allocations to be zero-initialized, e.g. `Klass` constructors.
But not all Metaspace allocation paths do this. Zero-initialization happens in Metaspace::allocate(), and some paths allocate directly from ClassLoaderMetaSpace (e.g. MetaspaceCriticalAllocation and VM_CollectForMetadataAllocation).
The simplest solution is to move zero initialization down to either ClassLoaderMetaSpace or even to MetaspaceArena.
We also may want to rethink this requirement (maybe a separate issue). But for now its simpler and easier just to zero allocate.
But not all Metaspace allocation paths do this. Zero-initialization happens in Metaspace::allocate(), and some paths allocate directly from ClassLoaderMetaSpace (e.g. MetaspaceCriticalAllocation and VM_CollectForMetadataAllocation).
The simplest solution is to move zero initialization down to either ClassLoaderMetaSpace or even to MetaspaceArena.
We also may want to rethink this requirement (maybe a separate issue). But for now its simpler and easier just to zero allocate.