简体   繁体   中英

iPhone memory management

I have been using instruments to check for leaks and other memory issues in my program. Though the leaks found by instruments are extremely small and don't matter, I have found that the physical memory free keeps going down while I use the program.

I use memory monitor to determine how much memory my app is using up and allocations to determine where this is mainly happening. I always make sure to release every time I alloc or retain, and seeing how there are barely any leaks, I'm assuming that my memory management is fine.

Does anyone know what I can do to fix this issue or reccomend a way to get to the bottom of it?

Even tho you release objects you dont need, that doesn't matter. You are probably allocating too much things and keeping them for some reason. You can try to check this out:

http://macdevelopertips.com/objective-c/objective-c-memory-management.html

http://akosma.com/2009/01/28/10-iphone-memory-management-tips/

I would advise you to check what you alloc and what you keep for the life of the application and see if you can make the same thing but without using so much memory.

Edit: I have to agree with Mark and Kongress, every leak matters for the sake of your app's life.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM