Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Basically, a 'leak' in garbage collected system is a bit different from more traditional systems where program itself had to manage memory. In the latter, memory leak would happen simply by allocating memory and not releasing it. There might be nothing referencing that allocated memory, but as there was no automatic way to reclaim it, allocation would be there 'forever' and was considered a leak.</p> <p>In GC system, memory leak is usually more about developer perception: 'as a developer, I don't understand why my application uses this much memory' as GC will only collect objects that are not being referred to. </p> <p>One might say that GC turns the logic around - in traditional systems, leaks happens when reference is 'lost' (=nothing refers to object (or whatever), and thus there is no way to release the allocation), but in GC system leak happens when reference <em>is</em> there. </p> <p>So you are basically looking for objects that you might consider to be garbage but are still being referred to in your code. Depending on size and complexity of your program this can be easy or very hard problem. Unfortunately I have not used MonoTouch myself so I can not give exact tips on tooling to help you (please see for instance this one: <a href="https://stackoverflow.com/questions/5321113/tips-techniques-for-tracking-down-leaks-in-monotouch-programs">Tips/Techniques for tracking down leaks in monotouch programs?</a>), but if you have access to heap (either 'live' or via a dump), you might be able to reason that presence of some objects is not what you would expect, and then by following the references understand which object is holding on to them.</p> <p>If you are limited to just reading the code and trying to understand the leak, I would start by checking the logic related to storing objects into collections. Are you adding some objects many times to same collection (such as a list)? Should you be removing some objects from collection but are not?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload