skip to content

questions

page 2 of 2

A collector cannot tell a reference from an integer in a thread's stack slot — what does guessing cost?

level: seniorimportance: nice to knowfreq 26%

basics

~20 s

It must treat every stack word that looks like a heap address as a reference, so it retains objects nothing really points to along with everything they reach — and it cannot safely rewrite such a word to relocate the object.

open as a page

When a copying or sliding-compaction collector relocates a live object, where is its new address recorded so references can be rewritten?

level: seniorimportance: nice to knowfreq 30%

basics

~20 s

An evacuating collector writes a forwarding address over the abandoned original, so any reference still pointing at the old location finds the redirect. A sliding collector cannot overwrite an object it has not moved yet, so it computes new addresses into a side word or table in a separate pass first.

open as a page

What does a post-mortem reference give a program that a cleanup hook attached to the object itself cannot?

level: seniorimportance: nice to knowfreq 24%

basics

~10 s

A post-mortem reference never hands the object back, so cleanup cannot resurrect it, and the notification arrives on a queue the program drains on its own thread and schedule, with ordinary error handling.

open as a page

showing 31–33 of 33