How to find out the biggest memory leaks?
For my iOS app tuning with instruments of xcode4,
- Using activity monitor
Real memory usage increase from 10+ MB to 100+ MB (I use iPod for testing, doubt that my app can use memory to 100+ MB, impossible ? )
- Using memory l开发者_运维知识库eaks
Sort up with bytes, the biggest memory blocks seem only 100 KB, seem like non-sense
Any good practice to find out the biggest memory leaking ?
Thanks
If it shows you 100MB+ then you probably use that much - this is what a memory leak can cause: because of not freeing allocated memory, even if memory blocks a small per se, it can cumulate to big numbers. And a lot of 100Kb blocks can sum up to a lot of memory, if you create lots of them.
So look not only on the biggest memory block but above all for the number of memory blocks or generally number of living objects. Make heap snapshots and compare them - after warming up you applications (warming means filling caches and variables) you should not see an increase in number of living objects any more.
精彩评论