XCode Instruments 6 (by far) not reflecting the correct amount of memory

空扰寡人 提交于 2019-12-23 02:19:12

问题


I've a huge difference between the amount of used memory displayed in XCode debug panel and the same info in Instruments. XCode shows 400 MB of allocated memory when Instruments only shows 42MB. I'm certainly closer to 400 than 42 as I've multiples 32MB textures loaded... (And this time, 42 is not the answer, btw)

XCode 6.0.1, iPad 3, iPhone 5S, iOS 7.1.2 on both, Profiling on real devices, but no problem doing the same thing on simulator.

Not an ideal situation to track memory consumption.

What goes wrong? Did I miss something? I filter on "All allocations" and "All heap and anonymous". Any idea ? Thx


回答1:


The Allocations instrument doesn't record OpenGL ES texture memory allocations. If your app is allocating multiple 32 MB textures, that would explain why Xcode is reporting memory usage of 400 MB and the Allocations instrument is reporting 42 MB.

Use the OpenGL ES Analysis template to look at your texture memory allocations. Use the Allocations instrument to look at the rest of your app's memory allocations.




回答2:


Found: https://stackoverflow.com/a/15536861/2292348

I think the activity monitor can be used to show real memory usage: https://developer.apple.com/library/mac/Documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/MemoryManagementforYouriOSApp/MemoryManagementforYouriOSApp.html



来源:https://stackoverflow.com/questions/26000809/xcode-instruments-6-by-far-not-reflecting-the-correct-amount-of-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!