Lava Sangeetham
Lava Sangeetham

Reputation: 3281

adb shell command to find the device RAM

I am trying to find device RAM (512 MB or 1GB) using adb shell commands.

Following commands giving more details about the free,used & total memory. But how to find the device overall RAM?

adb shell "cat /proc/meminfo"
adb shell dumpsys meminfo
adb shell procrank

Upvotes: 4

Views: 18086

Answers (2)

Wolfpack'08
Wolfpack'08

Reputation: 4128

People who post answers often forget that Windows users don't have access to grep, cat, etc. Add shell to the beginning of your pipe.

.\adb.exe -s whichever-device shell "cat /proc/meminfo | grep MemTotal"

This is assuming you're connected to multiple devices. If you're only connected to one, you can remove -s whichever-device (usually the ip if you're connected by wifi or the device number from the device list if connected by wire.).

Upvotes: -1

Gareth Higgins
Gareth Higgins

Reputation: 94

So it looks to me that MemTotal is probably the field you are looking for:

MemTotal — Total amount of physical RAM, in kilobytes.

While it is not the strictly Android, another Linux flavour CentOS provides the following page regarding /proc/meminfo. It seems that Red Hat, and other variants also describe it similarily.

Is there something that is making you suspect that this is not the physical RAM? On my device the value reported for MemTotal matches what I expect.

Upvotes: 7

Related Questions