且构网

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

如何了解xcode调试中的CPU和内存消耗

更新时间:2023-11-13 09:02:34

现代iPhone或iPad具有1024Mb内存。
但是,苹果从未透露过多少可用于应用程序的东西。
只需使用尽可能少的内存,并在操作系统通知您的应用有关内存不足的情况时释放不必要的内存。

A modern iPhone or iPad has 1024Mb memory. But how much of that is available for apps is something that Apple has never divulged. Just use as little memory as possible, and release non essential memory when the OS notifies your app about low memory.

同样,请使用尽可能少的CPU ,但更重要的是,请勿阻止UI线程。
使用探查器查找CPU使用的热点并尝试对其进行优化。

Similarly, use as little CPU as possible, but more importantly, do not block the UI thread. Use the profiler to find hot spots for CPU use and try to optimize those.