1

Let's say I want to prioritize a few processes that are running on a device with high memory pressure. These processes are UI processes (Android, specifically) and are running very slowly in this state. When I grep for my process in

ps -eo min_flt,maj_flt,cmd

I can see that my major page faults are very high (thousands for a UI actions like opening a new Android activity).

If renice my processes to a lower niceness (higher priority), can I expect to see less maj page faults? Increasing priority should give it more CPU resources, but I'm not sure if that will speed up the process if the bottleneck is memory pressure/page faults.

2

Increasing priority should give it more CPU resources, but I'm not sure if that will speed up the process if the bottleneck is memory pressure/page faults.

It won't. The nice level only affects the scheduler.

With root privileges, you can use mlockall(MCL_CURRENT|MCL_FUTURE) to lock mapped pages into RAM. On Linux. I don't know if any such facility is available on Android.

A while back there was a patch that would allow inheriting mlockall status across exec, which would allow the creating of simple wrapper programs to run any executable with mlockall. https://lwn.net/Articles/308552/ Unfortunately, the patch didn't make it into mainline Linux, so you'll have to edit the codez, or if it is a scripting language interpreter, find a way to make a native call to mlockall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.