Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How we can check that certain object is released memory

As I start working in swift, I am curious in memory mgmt. As we all know that during any object creation or assignment of data into that object it takes memory. How can we check that a particular object has released the memory. I used xcode memory report to see memory status and fluctuations.

Here is a sample of images:

enter image description here

enter image description here

How can release memory if I already set nil into the objects.

like image 463
Gourav Joshi Avatar asked Oct 07 '16 06:10

Gourav Joshi


1 Answers

Use instruments to track the lifecycle of an object than just Xcode because it gives you the allocation details at much higher level.

Check out the answer at https://stackoverflow.com/a/14891837/5133769. Though it was explained with old instruments it still works.

like image 141
Vikram Parimi Avatar answered Oct 01 '22 17:10

Vikram Parimi