--- old/src/share/vm/memory/metadataFactory.hpp 2014-08-12 23:08:02.916024968 -0700 +++ new/src/share/vm/memory/metadataFactory.hpp 2014-08-12 23:08:02.796020380 -0700 @@ -79,6 +79,12 @@ // Deallocation method for metadata template static void free_metadata(ClassLoaderData* loader_data, T md) { + if (DumpSharedSpaces) { + // FIXME: the freeing code is buggy, especially when PrintSharedSpaces is enabled. + // Disable for now -- this means if you specify bad classes in your classlist you + // may have wasted space inside the archive. + return; + } if (md != NULL) { assert(loader_data != NULL, "shouldn't pass null"); int size = md->size();