17
votes
7answers
2k views

Why does Garbage Collection only sweep the heap?

Basically, I've learned so far that garbage collection erases forever any data structure that is not currently being pointed to. But this only checks the heap for such conditions. Why doesn't it also ...