开发者

iphone app mysteriously getting slower and slower

I have an app. It starts out fine, but the longer I run it, the slower i开发者_开发百科t gets.

Instruments shows only a few hundred bytes of leaks.

How can I find the source of the problem?


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.


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜