Question

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().

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top