Вопрос

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