Identify CPU/memory intensive processes, adjust process priority with renice, and kill processes

To know the processes that make intensive use of the CPU or memory, we can use the TOP program:

top - display Linux processes

It’s good to know the priority list first:

+ HIGH PRIORITY                                                 - LOW PRIORITY
             |----------|----------|----------|----------|----------|----------|
nice value  -20        -10        -5          0          5          10         19

renice for running process

To adjust the priority(PR) of a running process, either increase or decrease, you must alter the value (NI) with renice command:

// for example, we open gedit editor and check the process with top:
$ gedit
The top program show us the gedit process with a default PR 20 and NI 0

The default priority for gedit is 20. Now I going to increase the priority to -8 as root:

# renice -n 8 -p 18925

nice for new process

The default priority for gedit is 20. Now I going to increase the priority to -5:

# nice -n -5 gedit
PR now is 15

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *