views:

70

answers:

2

I have an app. It starts out fine, but the longer I run it, the slower it gets.

Instruments shows only a few hundred bytes of leaks.

How can I find the source of the problem?

A: 

I've found leaks don't always show up, have a look at allocations, are they going up without going back down even though there are no leaks? Well, next to no leaks?

Rudiger
They go up all right. Live bytes come back down. Dead ones don't.
William Jockusch
+1  A: 

Leaks should in general not slow down your applications, they are causing iPhone going out of memory thus killing your app.

Performance problem has probably different reasons.

Are you creating lots of autoreleased objects ? For example in a loop ? Those will not cause any huge leaks, because they will be deallocated after loop's iteration, but this deallocation might be CPU consuming (if you do a lot in dealloc).

Another usual reason is the network latency. Do you call any network services ? Are your requests transferring more and more data over the time of using the app, thus slowing down the response ? Are your network calls done synchronously or asynchronously ?

Try to use CPU sampler in Instruments to figure out what methods take most of the time.

Michal
I was going to say that for slowness, he really needs to use CPU Sampler.
Kendall Helmstetter Gelner