src/hotspot/share/memory/metaspaceShared.cpp
changeset 51425 4e9667589c43
parent 51417 b08c2a94cce1
child 51429 d9f6e3ee7fcb
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Thu Aug 16 10:20:00 2018 -0700
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Thu Aug 16 17:29:22 2018 -0400
@@ -1873,6 +1873,8 @@
 
   int len = obj->size();
   if (G1CollectedHeap::heap()->is_archive_alloc_too_large(len)) {
+    log_debug(cds, heap)("Cannot archive, object (" PTR_FORMAT ") is too large: " SIZE_FORMAT,
+                         p2i(obj), (size_t)obj->size());
     return NULL;
   }
 
@@ -1883,9 +1885,14 @@
     relocate_klass_ptr(archived_oop);
     ArchivedObjectCache* cache = MetaspaceShared::archive_object_cache();
     cache->put(obj, archived_oop);
+    log_debug(cds, heap)("Archived heap object " PTR_FORMAT " ==> " PTR_FORMAT,
+                         p2i(obj), p2i(archived_oop));
+  } else {
+    log_error(cds, heap)(
+      "Cannot allocate space for object " PTR_FORMAT " in archived heap region",
+      p2i(obj));
+    vm_exit(1);
   }
-  log_debug(cds, heap)("Archived heap object " PTR_FORMAT " ==> " PTR_FORMAT,
-                       p2i(obj), p2i(archived_oop));
   return archived_oop;
 }