【问题标题】:Slow down processes in didReceiveMemoryWarning()减慢 didReceiveMemoryWarning() 中的进程
【发布时间】:2019-11-03 00:53:54
【问题描述】:

当 RAM 达到 x 内存量或调用 didReceiveMemoryWarning() 时,是否有办法减慢处理器速度?

func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning();
}

【问题讨论】:

  • 如果有,会有什么帮助?你想达到什么目的?

标签: swift memory memory-management memory-leaks out-of-memory


【解决方案1】:

您无法从应用程序控制 CPU 内核/资源。只有操作系统可以控制它。在didReceiveMemoryWarning 方法实现中,不要寻求降低 CPU 的速度,而是优化代码以使用更少的内存,并丢弃应用正在使用的任何额外内存。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-13
    • 1970-01-01
    • 1970-01-01
    • 2011-01-19
    相关资源
    最近更新 更多