I recently bought a Moto Atrix 2 mobile. When I tried to look at the processor specs in the phone, Runtime.getRuntime().availableProcessors() returned 1. /proc/cpuinfo too had information about just processor 0.
Out of curiosity I checked the same in my friend's Samsung Galaxy S2, which is again a dual core phone. This too showed that no. of cores is 1.
I checked the same in my Moto xoom tablet which is again dual core. This time availableProcessors() returned 2 and cpuinfo also had both processor 0 and processor 1 details.
I am confused. Why some devices carry different information? Can someone explain this anomaly?
Runtime.getRuntime().availableProcessors()
only returns the number of online processors, so it will return 1 when the second core is sleeping. This is done in order to preserve power during less resource-intensive tasks.
To see all available cores, look at /sys/devices/system/cpu/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With