8319376: ParallelGC: Forwarded objects found during heap inspection
Co-authored-by: Albert Mingkun Yang <ayang@openjdk.org> Reviewed-by: ayang, tschatzl
This commit is contained in:
parent
7c7f8ea30d
commit
59e9981ec2
@ -235,7 +235,18 @@ void MutableSpace::oop_iterate(OopIterateClosure* cl) {
|
|||||||
void MutableSpace::object_iterate(ObjectClosure* cl) {
|
void MutableSpace::object_iterate(ObjectClosure* cl) {
|
||||||
HeapWord* p = bottom();
|
HeapWord* p = bottom();
|
||||||
while (p < top()) {
|
while (p < top()) {
|
||||||
cl->do_object(cast_to_oop(p));
|
oop obj = cast_to_oop(p);
|
||||||
|
// When promotion-failure occurs during Young GC, eden/from space is not cleared,
|
||||||
|
// so we can encounter objects with "forwarded" markword.
|
||||||
|
// They are essentially dead, so skipping them
|
||||||
|
if (!obj->is_forwarded()) {
|
||||||
|
cl->do_object(obj);
|
||||||
|
}
|
||||||
|
#ifdef ASSERT
|
||||||
|
else {
|
||||||
|
assert(obj->forwardee() != obj, "must not be self-forwarded");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
p += cast_to_oop(p)->size();
|
p += cast_to_oop(p)->size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user