Coldsteel48
Coldsteel48

Reputation: 3522

iOS 6.1 and above using ARC having a leak

I am implementing a simple application for iOS 6.1 and above I am using iOS SDK 6.1 and ARC enabled in my project.

when I run analyze inside the xCode it doesn't find anything , but when I transferred my app(simulator) to instruments it found a leak of 128 bytes called

Malloc 128 bytes 0x7f95724139d0

the question is: How do I know where it happens inside my application

I did read this https://developer.apple.com/library/mac/documentation/developertools/conceptual/instrumentsuserguide/MemoryManagementforYouriOSApp/MemoryManagementforYouriOSApp.html

But when I click on cycle it is empty :( , also StackTrace says :

    "No stack trace available    for this leak;it maybe allocated before the 
Allocation instrument was attached. 

However I started the instruments before I run my app . I guess I am doing something wrong here, Can someone please help finding the part of code that causing leak?

Upvotes: 0

Views: 155

Answers (1)

Duncan C
Duncan C

Reputation: 131503

Run your app on an actual device and then check again.

I have seen "phantom" leaks from the simulator before.

You should always test performance and memory issues on a real device rather than the simulator.

Note that a once-per-lifetime leak of 128 bytes is like a sink faucet that leaks a single drop of water after it's turned off. It's totally insignificant and can be safely ignored. The only time a leak that small is a concern is when it happens over and over. Like every time through a loop. In that case a 128 byte leak would be bad.

Upvotes: 4

Related Questions