To show top 5 processes by cpu
$ adb shell top -m 5 -s cpu
Sample outcome
User 16%, System 3%, IOW 0%, IRQ 0% User 294 + Nice 0 + Sys 63 + Idle 1439 + IOW 8 + IRQ 0 + SIRQ 0 = 1804 PID PR CPU% S #THR VSS RSS PCY UID Name 31732 0 16% S 15 1808356K 650552K fg u0_a190 com.foo.bar 529 0 1% S 20 132188K 9312K fg media /system/bin/mediaserver 1411 0 1% S 152 2448952K 158664K fg system system_server 427 0 1% S 16 215528K 11708K fg system /system/bin/surfaceflinger 31959 5 0% R 1 3996K 1296K fg shell top
To show top 5 processes by mem
$ adb shell top -m 5 -s rss