On Tue, 7 Nov 2023 10:02:04 GMT, Albert Mingkun Yang <ay...@openjdk.org> wrote:
> > Would the failed-promotion slide directly into full-GC which repairs it? > > No, promotion-fail objects are specially handled, as documented in > `PSPromotionManager::oop_promotion_failed`. Other successfully forwarded > objects are essentially dead, so during a full garbage collection, they are > skipped. Ok. Just to clarify: After failed promotion, all references to original copies of promoted objects are updated, and therefore the original copies are dead (and can safely be skipped)? Or is has no reference been updated yet, and therefore the new copies are dead and can be skipped? > If a young garbage collection is successful, the eden/from space is cleared, > which is why object iteration doesn't expose the "forwarded" markword. Yes, that makes sense. > The patch above is just intended to demonstrate a way of suppressing the > assertion, but it's likely not the best or correct way to proceed. I thought so. > Perhaps object-iteration logic in ParallelGC should skip those with the > "forwarded" markword (because they are dead objs)? (This makes sense to me > semantically, but I'm not sure about the potential consequences, given that > object iteration is possibly used in many places.) If the first statement above is true, then this seems reasonable. I will give it a try. Roman ------------- PR Comment: https://git.openjdk.org/jdk/pull/16494#issuecomment-1798419996