O'Reilly logo

Learning Swift by Andrew J Wagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Strong reference cycles

A strong reference cycle is when two instances directly or indirectly hold strong references to each other. This means that neither object can ever be deleted because both ensure that the other always exists.

This scenario is our first really bad memory management scenario. It is one thing to keep around memory longer than it is needed, but it is a whole different level to create memory that can never be freed up to be reused again. This type of memory problem is called a memory leak because the computer slowly leaks memory until there is no longer new memory available. This is why you will sometimes see a speed improvement after you restart your device. Upon restarting, all of the memory is freed up again. Modern operating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required