I'm trying to use busybox 'nice' and 'renice' to adjust Android process priorities, but I can't tell if they take effect. I tried using 'ps' and 'busybox top' in adb shell, but those don't display priority. Is there a way to see and adjust priority within adb?
The basic Android "ps -p" will show process priorities. "ps -t -p" will show them for all threads. Not sure how to get the same thing out of busybox.
They also appear in the stack traces from the Dalvik VM. If you hit the process with a SIGQUIT (kill -3 ), it'll dump to dalvik.vm.stack-trace-file, which defaults to /data/anr/traces.txt. The output looks like:
"WindowManager" prio=5 tid=20 NATIVE | group="main" sCount=1 dsCount=0 obj=0x409404d8 self=0x264970 | sysTid=2884 nice=-4 sched=0/0 cgrp=default handle=2510248 | schedstat=( 4116000 5332000 12 ) utm=0 stm=0 core=0
This shows the "nice" value, as well as scheduling priorities and the cgroup. (Exact output varies from release to release.)
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