FollowReferences reports non-class objects as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 26
    • Affects Version/s: 26
    • Component/s: hotspot
    • None
    • generic
    • generic

      FollowReferences function with null initial_object traverse objects starting from "heap roots". Hep roots includes "set of system classes", and the classes are reported with reference kind JVMTI_HEAP_REFERENCE_SYSTEM_CLASS.
      Actually a lot of non-class objects are reported as JVMTI_HEAP_REFERENCE_SYSTEM_CLASS - java.lang.Module and [Ljava.lang.Object;

      To reproduce:
      implement JVMTI agent which calls FollowReferences with jvmtiHeapReferenceCallback:
      heap_reference_callback(jvmtiHeapReferenceKind reference_kind,
                              const jvmtiHeapReferenceInfo* reference_info,
                              jlong class_tag,
                              jlong referrer_class_tag,
                              jlong size,
                              jlong* tag_ptr,
                              jlong* referrer_tag_ptr,
                              jint length,
                              void* user_data) {
        if (reference_kind == JVMTI_HEAP_REFERENCE_SYSTEM_CLASS) {
          *tag_ptr = 1;
        }
        return JVMTI_VISIT_OBJECTS;
      }

      And then call GetObjectsWithTags for objects with tag 1.
      returned array contains a lot of non-class objects

            Assignee:
            Alex Menkov
            Reporter:
            Alex Menkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: