SkyEagle888
SkyEagle888

Reputation: 1009

Unknown Memory Leakage

I am analyzing an iOS application to check the memory leakage with Instruments.I selected Allocations and/or Leakage to check with.

When the application runs, the All Allocations grows up to 1.3MB. After I click on a button, show a picker, then select an item and remove the picker, the All Allocations grows up. I checked that there is no obvious memory leakage as there is no RED bar.

Is there any clue ? I found that there are many unknown Malloc 16 Bytes, ... Malloc 32 Bytes, ... But there is no useful information for me to keep tracing.

Is there any other ways to approach such issues ?

Upvotes: 1

Views: 367

Answers (1)

zaph
zaph

Reputation: 112857

Use Heapshot to find memory creap, see: bbum blog

Basically there method is to run Instruments allocate tool, take a heapshot, run an intuition of your code and another heapshot repeating 3 or 4 times. This will indicate memory that is allocated and not released during the iterations.

To figure out the results disclose to see the individual allocations.

If you need to see where retains, releases and autoreleases occur for an object use instruments:

Run in instruments, in Allocations set "Record reference counts" on on (you have to stop recording to set the option). Cause the picker to run, stop recording, search for there ivar (datePickerView), drill down and you will be able to see where all retains, releases and autoreleases occurred.

enter image description here

Upvotes: 1

Related Questions