What garbage collection actually costs
Every computer program needs memory. Memory is finite, so a long running program
must borrow memory from the operating system when it needs it and release it
once it is no longer needed.
The interesting part is who reclaims that memory, and when. Some piece of code
has to figure out that a piece of memory is no longer needed and release it, and
figuring that out is not trivial. A value might be passed to another function,
stored somewhere longer-lived, or shared across threads, and it stays need...
Read more at shivanshuag.com