2

I'm using my Ubuntu OS to play Minecraft. I can get the game to run a little faster by closing my other programs and giving the Minecraft java process a higher priority via the System Monitor. The process is simply named "java" in the list.

I change "Normal" to "Very High"

How can I make Minecraft automatically take a higher priority when it starts?

2
  • How do you start minecraft?
    – A.B.
    May 28, 2015 at 17:12
  • Trae7: If the answer below helped you, don't forget to click the grey at the left of its text, which means Yes, this answer is valid! ;-)
    – Fabby
    Aug 30, 2015 at 10:13

1 Answer 1

1

TL;DR You need nice for this:

sudo nice -n -20 <your_command>

Start minecraft with this command:

sudo nice -n -20 su -c java -jar minecraft.jar $USER

If you have a desktop file for minecraft then change the property Exec and install the package gksu, we need gksudo:

sudo apt-get install gksu

Example (Replace <your_username> with your username, the output of echo $USER. $USER doesn't works in a desktop file):

[Desktop Entry]
Type=Application
Name=Minecraft
GenericName=Game
Comment=Break and place blocks to build imaginative things
Exec=gksudo "nice -n -20 su -c 'java -jar /usr/share/minecraft/minecraft.jar' <your_username>"
Icon=minecraft
Categories=Game
StartupNotify=true
StartupWMClass=net-minecraft-bootstrap-Bootstrap

The Linux niceness scale goes from -20 to 19. The lower the number the more priority that task gets. If the niceness value is high number like 19 the task will be set to the lowest priority and the CPU will process it whenever it gets a chance. The default nice value is zero.

Source

from man nice:

-n, --adjustment=N
              add integer N to the niceness (default 10)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .