2

I recently installed Arch Linux on a very old laptop. As such, I am trying to optimize it as much as possible and cut down on CPU/RAM usage. Attached is a screenshot I took of htop on the laptop without much running other than a terminal: enter image description here

There are several things about this that confuse me.

  • The first is that the total CPU usage seems much larger than the sum of the individual CPU usages from all the processes (there are a few more if you scroll down, but all show 0.0% CPU usage). Why is this? There have been times where both cores have been at around 80% capacity, with the CPU audibly being put under a fair amount of strain, and htop still shows a similar output.
  • I was unable to get a screenshot of this because they only show up for a short time, but occasionally the commands pgrep -x cmus and pgrep -x spotify will briefly show up on htop, while using somewhere around 10% of the CPU. I have very few programs installed on this laptop and have never installed Spotify or (I believe) anything Spotify-related. What's the cause of these commands showing up?

1 Answer 1

1

Regarding the pgrep portion of the question, from the pgrep man page:

pgrep  looks  through  the  currently running processes and lists the process IDs
       which match the selection criteria to stdout.  All the criteria  have  to  match.

and the -x option:

-x, --exact
              Only match processes whose names (or command line if -f is specified)  ex‐
              actly match the pattern.

So, those pgrep lines indicate that something on your system is searching to see if cmus and/or spotify are running on your system (and presumably not finding them, if they are not installed).

About the mismatch with CPU utilization: I am not sure. However, I think one possibility is that htop is only showing userspace processes. Presumably, the kernel itself is also using some of the CPU, but I would not expect htop to include a line for the kernel space. However, I don't know if 25%+ CPU usage by the kernel on average would make sense. You say your system is 'very old' but don't go into specifics. Perhaps it is so old that the kernel itself is requiring a significant proportion of the CPU? Maybe some kernel module is 'misbehaving' or not working well with that hardware and thrashing the CPU?

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.