문제

According to the NSProcessInfo docs, -physicalMemory returns the "amount of physical memory in bytes.". However, on my 32 GB iPhone 5, it returns 1065000960, which is only around 1 GB (1016 MB). What's up with that? Does it actually return the number of blocks or something? Could this be a bug in the API?

FWIW, I get the same value using sysctl().

도움이 되었습니까?

해결책

The -physicalMemory method is returning the amount of RAM (volatile storage) present in the device, which for the iPhone 5 is 1GB.

The "32GB" figure quotes in the device model is non-volatile flash storage (think SSD), which is separate from RAM.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top