5
3
I use a nice (free) process manager called ATMonitor for Mac OS X that has a lot of cool hidden features, one of which is being able to click on a running process and set the "renice" from +20 (less priority) to -20 (highest priority).
The best part is that it sticks between restarts. So you want XYZ to get full attention all the time, you set it once and it's done.
I want to do the same thing (renice a process) on an iPad running a particular daemon, and I don't know how to set a renice permanently.
I can do it once, and it works fine, but the setting is lost on a reboot. I read somewhere.
Now, as for permanently resetting the priority of a process, this can't be done directly. You can fake it, however, with a shell script that starts the app and then immediately renice's it. Give that script a ".command" extension and it will be double-clickable in the GUI. Not very elegant, but it gets the job done.
But as it says, not very elegant, and I dont think this is how ATMonitor does it.
I found this question and they gave a way to do it as a launch argument, but no apparent way to save it as a persistent value. For instance, if the program wasn't going to be started by launchd.
How do I set a permanent renice level, per executable binary, independent of its PID, when, how, or why it was launched?
This question was just bumped to the front page of this site by an automated process. I'd appreciate if you could respond to my answers to both of your questions, either accepting them or mention what doesn't work for you, to give me or others a chance to respond. – Daniel Beck – 2011-07-07T07:40:09.950
I guess the "old-fashioned" way to do it would be to just write a shell script and occasionally set the nice levels.. but I am almost sure there is a way to do this via launchd's "limit" [cpu | filesize | data | stack | core | rss | memlock | maxproc | maxfiles] [both [soft | hard]] W/ no arguments, this command prints all the resource limits of launchd as found via getrlimit(2). When a given resource is specified, it prints the limits for that res. 3Args, it sets both the hard and soft lims to that value. w/ 4 arguments, the 3+4 args rep the soft and hard limits respect. I'm just not sure – mralexgray – 2011-07-07T09:05:14.823