< prev index next >

test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.cpp

Print this page
@@ -527,10 +527,15 @@
                                jlong size) {
    jvmtiFrameInfo frames[64];
    jint count;
    jvmtiError err;
  
+   if (!jni->HasIdentity(object)) {
+     // weak references are prohibited for non-identity objects, skip them
+     return;
+   }
+ 
    err = jvmti->GetStackTrace(thread, 0, 64, frames, &count);
    if (err == JVMTI_ERROR_NONE && count >= 1) {
      ObjectTrace* live_object;
      jvmtiFrameInfo* allocated_frames = (jvmtiFrameInfo*) malloc(count * sizeof(*allocated_frames));
      memcpy(allocated_frames, frames, count * sizeof(*allocated_frames));
< prev index next >