开发者

Crash because of low Memory

My app crash on ipod 3g and in crash reporter file the name of crash file is "low memory ..." does this crash because of low memory or this name is fake ?开发者_运维知识库 What should i do to solve it ?


This is not a fake name. First thing you should do is run the "leaks" performance tool on your app to see if you are leaking memory. This is most likely the problem, otherwise you are using too much memory and you need to find a way to do what you want with less memory.

Help with running the leaks program: Memory leak detection tools


This is definitely not a fake name, and to debug you should first use the Instruments app provided with xcode and specifically look at the 'Allocations' and 'Leaks' instruments from the library.

Run these on your app and it will help you to identify how and where your code is leaking so much memory that it causes the OS to kill it.

There's several ways you can reduce memory usage in a basic app, here's a couple of generic ones:

  • Remember to release / autorelease everything you alloc
  • Reuse table cells if applicable
  • Try to cache things on disk, rather than in memory when loading from a resource
  • Remove debug code / features
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜