!!all promotions are "awarded" to long-surviving objects

GC commentators usually tiptoes around this tricky topic — “generational GC typically promote an object from eden to old gen only when it has survived a few minor collections”. It’s not a hard guarantee that every promoted has survived at least 2 minor GC[1]

[1] but I believe there is a guarantee of at least 1 survival. Very simple, promotion can only happen during collection. If an object is promoted then it must be live at the time.

[[javaPerformance]] make it clear that premature promotion does happen — a new object is promoted during its very first collection. This object (like all new objects) is likely to become garbage soon, but once promoted will not be examined until a major GC. This tends to litter the oldgen with garbage.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s