--- old/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter-tagged/HeapFilter.cpp 2018-11-28 12:52:52.000000000 -0800 +++ new/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap/filter-tagged/HeapFilter.cpp 2018-11-28 12:52:51.000000000 -0800 @@ -421,6 +421,7 @@ int object; int field; for (object = 0; object < (reachable?TEST_OBJECTS_COUNT:TAGGED_OBJECTS); object++) { + int tagged = object == 0; for (field = 0; field < objects_info[object].fields_count; field++) { // If primitive field of object that was not collected or // non primitive field that was not collected was not found @@ -430,8 +431,9 @@ || (!objects_info[object].fields[field].primitive && !objects_info[object].fields[field].collected)) { - if (objects_info[object].fields[field].expected != - objects_info[object].fields[field].found) { + int expected = objects_info[object].fields[field].expected; + int found = objects_info[object].fields[field].found; + if (tagged ? expected != found : expected > found) { NSK_COMPLAIN4("Field %s::%s expected to be found %d times, " "but it was found %d times.\n", objects_info[object].name,