且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有没有办法设置iPhone模拟器中可用的内存量?

更新时间:2023-02-25 13:16:56

不可能。

应该在设备而不是模拟器上测试内存消耗和性能等内容。即使您可以限制模拟器中的内存,也不会获得相同的效果,因为有很多不同的因素会决定任何给定的iPhone设备目前可用的内存量。

Testing things like memory consumption and performance should be done on the device, not the simulator. Even if you could limit the memory in the simulator you wouldn't get the same effect as there are very many different factors that will dictate how much available memory any given iPhone device will currently have.

您可以模拟内存警告来测试您对该警告的响应是否正常,但除此之外,您应该在物理设备上测试此类内容。

You can simulate a "memory warning" to test if your responses to that warning behave correctly, but other than that, you should really be testing this kind of thing on a physical device.