When you create an object, and you assign it to some variable, it’s termination isn’t tied up to the lifetime of a given variable.
This means that with the destruction of the variable, only a reference to the object is destroyed, but the object itself is still allocated in the memory.
If there are too many objects in the memory, the program will eventually run out of resources and won’t be able to perform further operations.
Thanks to the techniques such as Garbage Collection or Automatic Reference Counting, we don’t need to do that anymore.
Here’s how they work.
Please Like and Subscribe for more weekly videos!
Follow me on Twitter: / thecompscirocks
Follow me on Instagram: / thecompscirocks
Follow me on Facebook: / thecompscirocks
Some sources & further reading:
https://en.wikipedia.org/wiki/Object_...
https://en.wikipedia.org/wiki/Referen...)
https://en.wikipedia.org/wiki/Garbage...)
https://en.wikipedia.org/wiki/Automat...
http://www.thomashanning.com/retain-c...
https://en.wikipedia.org/wiki/Memory_...
https://www.dynatrace.com/resources/e...
https://developer.apple.com/library/c...
Auf dieser Seite können Sie das Online-Video Garbage Collection And Automatic Reference Counting Explained mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer CSRocks 19 Oktober 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 21,200 Mal angesehen und es wurde von 420 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!