Zubair Akber
Zubair Akber

Reputation: 2828

Get Memory-RAM information consumed by an app using shell command

I just want to get RAM information consumed by a specific app using shell command, currently i as using ps -x | grep 'packageName' but its results vary with the memory shown by profiler

This is the result of the above command that i am using

u0_a73 7623 4287 3271364 225728 SyS_epoll_ 73289f334c S packageName (u:193963, s:87819)

The bold part is the ram consumed by the app in kB

Upvotes: 1

Views: 72

Answers (1)

Dudi Boy
Dudi Boy

Reputation: 4865

Try this:

ps -x|awk '/packageName/{print $5}'

The awk command extract the 5th word from the ps -x output having packageName in the line.

Upvotes: 1

Related Questions