Lol don't forget the part about being in the middle of the dark so you're walking around not knowing where the lego pieces are. That's the biggest part of memory leaks that is frustrating.
To extend the lego block analogy and make the explanation unnecessarily more complicated for applications running with managed memory models (e.g. C# and Java)...
Imagine there is an invisible robot vacuum cleaner (i.e. the garbage collector) that runs around automatically picking up lego blocks.
Nobody is really sure when the robot will run and what it will pick up.
Sometimes it will not pick up some of the blocks even when you know it has run (e.g. when memory is pinned) and sometimes the block could be collected but the robot just doesn't feel like picking it up on that run.
To frustrate you further, when you go looking for leaked blocks, sometimes they are chained together and the root block actually stopping a bunch of other blocks from being collected is a block you least suspect.
I forgot to mention that it is also a Heisenberg robot so when you go looking for leaked blocks, the robot starts behaving differently.
So in conclusion, not only do you trip over the blocks in the dark but you might get super lucky and trip over the invisible robot vacuum too!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Lol don't forget the part about being in the middle of the dark so you're walking around not knowing where the lego pieces are. That's the biggest part of memory leaks that is frustrating.
To extend the lego block analogy and make the explanation unnecessarily more complicated for applications running with managed memory models (e.g. C# and Java)...
Imagine there is an invisible robot vacuum cleaner (i.e. the garbage collector) that runs around automatically picking up lego blocks.
Nobody is really sure when the robot will run and what it will pick up.
Sometimes it will not pick up some of the blocks even when you know it has run (e.g. when memory is pinned) and sometimes the block could be collected but the robot just doesn't feel like picking it up on that run.
To frustrate you further, when you go looking for leaked blocks, sometimes they are chained together and the root block actually stopping a bunch of other blocks from being collected is a block you least suspect.
I forgot to mention that it is also a Heisenberg robot so when you go looking for leaked blocks, the robot starts behaving differently.
So in conclusion, not only do you trip over the blocks in the dark but you might get super lucky and trip over the invisible robot vacuum too!