FWIW GCs are never invoked after each allocation - that would be prohibitively expensive, so there is nothing Dart specific here.
You might have been thinking about how some languages use reference counting which would free the memory occupied by an object immediately after the last reference to it disappears.
Okay ! Now i get it.
It's really interesting how GC is handled in Dart. Makes me wanna explore more on that !
Thanks again for sharing your insights.
FWIW GCs are never invoked after each allocation - that would be prohibitively expensive, so there is nothing Dart specific here.
You might have been thinking about how some languages use reference counting which would free the memory occupied by an object immediately after the last reference to it disappears.
Yeah, i have been following the same concept here. Guess i didnt go about it the right way !
So, the languages that incorporate reference counting approach to freeing a memory immediately is less efficient ? Or did i miss anything ?