hotspot/src/share/vm/oops/cpCache.cpp
changeset 47095 9d21da6fe729
parent 46810 7dad333205cd
child 47103 a993ec29ec75
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Tue Aug 29 12:17:02 2017 +0200
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Wed Aug 30 07:18:02 2017 -0400
@@ -26,6 +26,7 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/rewriter.hpp"
 #include "logging/log.hpp"
+#include "memory/metadataFactory.hpp"
 #include "memory/metaspaceClosure.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.inline.hpp"
@@ -608,6 +609,14 @@
   }
 }
 
+void ConstantPoolCache::deallocate_contents(ClassLoaderData* data) {
+  assert(!is_shared(), "shared caches are not deallocated");
+  data->remove_handle(_resolved_references);
+  set_resolved_references(NULL);
+  MetadataFactory::free_array<u2>(data, _reference_map);
+  set_reference_map(NULL);
+}
+
 #if INCLUDE_CDS_JAVA_HEAP
 oop ConstantPoolCache::archived_references() {
   assert(UseSharedSpaces, "UseSharedSpaces expected.");