是否可以确定 iOS 设备的实际 RAM 大小?
提到这个问题Determining the available amount of RAM on an iOS device我们可以确定可用的空闲内存,但如何获得实际的总大小。
最佳答案
查找设备中总 RAM 的最简单解决方案是使用 NSProcessInfo
:
Objective-C :
[NSProcessInfo processInfo].physicalMemory
swift 3:
NSProcessInfo.processInfo().physicalMemory
swift 5:
ProcessInfo.processInfo.physicalMemory
注意:physicalMemory
给我们以字节为单位的信息,要计算 GB,除以常量 1073741824
。
记录在案here .
关于ios - iOS 设备的总 RAM 大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20211650/