16

I am trying to understand , what is meaning of transient and persistent Column in Allocation Template . From the tutorial http://www.raywenderlich.com/97886/instruments-tutorial-with-swift-getting-started I have found "The Persistent column keeps a count of the number of objects of each type that currently exist in memory. The Transient column shows the number of objects that have existed but have since been deallocated. Persistent objects are using up memory, transient objects have had their memory released. " enter image description here

According to the explanation above , From the selected row in Statistics table from the picture , it can be said , 2 objects of NSFileManager currently exist in memory and 19 no. of objects are created and already have been released.

But what it means for optimization or performance issues for iOS App ? Something like , here the total no of transient object in 19 which is considerably a large number , it should be small if possible for increasing app's effective memory usability or Something else ?

2 Answers 2

5

Optimization for performance in short means keeping your app alive and responsive. The key metric for optimization is not transient or persistent count for one object.

Based on the information your NSFileManager is using 16 Bytes for each object. So it's 32 currently persistent (2 * 16) and 336 (21 * 16) Total.

A high persistent memory indicates that your current footprint is very high for the given object. A high total memory indicates that your footprint in past might have been high (if subset of those allocation were simultaneous)

While optimizing you should focus on mainly two aspects:
 1. How much is the minimum memory foot print when your app loads.
 2. How much is the maximum memory foot print. (You need to come up with use cases to figure out this one). 

As your memory footprint increases your app slows down in performance because of multiple page swaps done by OS to free up memory. You can track this by VM tracker instrument. Optimization means keeping your average memory footprint lower that point.

3

Persistent objects are using up memory, transient objects have had their memory released.

The first says # Persistent. This is the number of persistent objects that are being strongly referenced in your project at this moment in time. The second says # Transient. This is the number of deallocated objects that used to be strongly retained but now no longer exist. This is handy because it lets you know if an object is being cleaned up properly or if an object in no longer retained in a particular moment in time. The third says # Total. This is the total count of persistent and transient objects added together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.