From Dev.to
The garbage collector never looks for garbage
You'd think the garbage collector walks around memory looking for junk to throw away. It doesn't. It finds everything you can still reach, then deletes whatever's left. That's the whole idea. Here's...
