3 ms·
I think Raymond Chen once noted that garbage collection just aims to give the programmer the illusion of infinite memory under the assumption that only finite a
by ygra 10y ago
I think Raymond Chen once noted that garbage collection just aims to give the programmer the illusion of infinite memory under the assumption that only finite amounts of memory are every in use at once, while also absolving them from having to release memory manually.
So if your program allocated less than available, doing nothing would be a valid GC strategy as your program never hit an upper bound in what it can allocate.
I found that an interesting way to think about the problem because it's more concerned with what GC enables instead of what it strictly does. The former is always the same, no matter the GC implementation, but the latter can vary considerably (doing nothing, reference counting, mark-and-sweep, full concurrent and compacting GC, ...).
- toomim 10y ago> garbage collection just aims to give the programmer the illusion of infinite memory under the assumption that only finite amounts of memory are every in use at once, while also absolving them from having to release memory manually. Interestingly, this is also the description of Virtual Memory. https://en.wikipedia.org/wiki/Virtual_memory https://en.wikipedia.org/wiki/Virtual_memory