arm6 设备显示出更高的内存使用率
我在 MonoTouch 中构建了一个应用程序 - 它适用于arm6和arm7设备,我尝试尽可能小心地使用内存,并且在arm7设备上它工作得很好 - 通过我可以看到的苹果仪器程序运行它分配工具中的平均“活动字节”约为 4MB。
然而,在 arm6 设备(iPhone 3G、iPod touch 第二代)上,它显示的内存使用量约为 22MB,频繁出现内存不足警告,显然最终会崩溃。
与 3GS (arm7) 设备相比,是否有任何构建设置或任何特定的事情可能导致应用程序在 3G 设备上具有如此高的内存占用? 尤其令人沮丧的是,这些设备无论如何都有足够的内存。
感谢您抽出时间,
利亚姆
I have built an app in MonoTouch - it works with both arm6 and arm7 devices, I've tried to be as careful as possible with my memory usage and on the arm7 devices it works beautifully - running it through the apple instruments program I can see an average 'live bytes' in the allocations tool of around 4MB.
However on the arm6 devices (iPhone 3G, iPod touch 2nd Gen) - it is instead showing memory usage of around 22MB - gives frequent low memory warnings and obviously eventually crashes.
Is there any build setting or any particular thing that anyone can think of that could be causing the app to have such a high memory footprint on the 3G device vs the 3GS (arm7) devices?
It's especially frustrating as these devices have plenty of memory anyways.
Thanks for your time,
Liam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个巨大差异!
我的最佳猜测是Apple的Instruments误报正在使用的内存(在任一情况或两种情况下),而事实上,真实内存两者的要求更加接近。
在这种情况下,较旧的 armv6 设备的 RAM 较少,并且会在较新的 armv7 设备(具有更多 RAM)之前发出内存不足的警告。 IOW 您看到的行为可能是正常的,即您可能接近旧设备的限制。
现在它也可能是一个 bug 或您的版本之间不同的其他配置(例如调试 与 发布 版本)。如果您可以与我们 (Xamarin) 分享(或创建测试用例),这将很有帮助,以便我们可以尝试重现该问题。
注意:
我假设您正在谈论在不同设备上使用的单个armv6应用程序。但即使您使用不同的构建(一种用于 arm6,一种用于 armv7 或 fat 应用程序),这也只会影响本机代码生成。因此,它会影响二进制大小,但它不应该对应用程序的运行时内存需求产生(巨大)影响。
That's a huge difference!
My best guess is that Apple's Instruments is misreporting the memory being used (in either or both case) and that, in fact, the real memory requirements of both are much closer.
In this case the older, armv6, devices have less RAM and will give low memory warnings before the newer, armv7, devices (with more RAM). IOW the behaviour you're seeing could be normal, i.e. you could be near the limits for older devices.
Now it could also be a bug or some other configuration that differs between your builds (e.g. a Debug versus a Release build). It would be helpful if you could share (or create a test case) this with us (Xamarin) so we can try to reproduce the issue.
NOTE:
I assume you're talking about a single, armv6, application used on different devices. But even if you used different builds (one for arm6 and one for armv7 or a fat application) this would only affect native code generation. As such it will affect the binary size but it should not have a (huge) effect on the runtime memory requirement of applications.