4

For some hours, I experience frequent peaks in the CPU usage of my laptop, due to a java process I don't know about, even if it is run by in my session (see firt line below).

enter image description here

Peaks occur irregularly (about every 5 minutes) and last about 20 seconds. I am not doing anything special when they occur (actually typing some text in TeXstudio). It continues even after having rebooted my system.

How could I narrow down the cause of this issue?

Edit: Thanks to Andrew's answer, I've found that the peaks are cause by /proc/4146/exe -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java... but I'm not sure what triggers it.

2
  • Press c in top to see the full command, then use the right arrow to see more about the command. It'll probably include the name of the Java class that's being executed. You can alternatively run ps aux | fgrep java. Mar 29, 2017 at 1:44
  • @ChaiT.Rex Thanks! Indeed, running top -o PID (to sort processes by ID) and then hitting C easily led me to incriminate LanguageTool for an issue previously reported. Could you please write an answer that I'd be pleased to accept?
    – ebosi
    Mar 29, 2017 at 1:55

4 Answers 4

5

In top, you can press c to show the whole command, then use to see more about the command, which will probably include the name of the Java class that's being executed.

Results are sorted by their CPU use (%CPU). If you want to sort results otherwise, you can run top -o <name of the colum> (e.g. top -o PID to sort by process ID, or top -o %MEM to sort processes by the amount of memory used).

You can alternatively run ps aux | fgrep java to see all running java processes.

2
sudo ls -l /proc/PID/exe

Will show you where it is located, which will help locate the app in question.

2

I spent awhile trying to track down a similar process that was using all of my CPU. If you have been using docker recently on your local machine, make sure to check whether the process that is using all your CPU is coming from docker.

sudo docker container ls` to see running containers

Run

sudo docker stop <container-name>

to stop it and

sudo docker rm <container-name>

to remove it.

0

I had similar issue where my CPU usage by java went more than 100%, I was running Eclipse IDE on on Ubuntu and there was build process started on Ubuntu which caused this issue.

Build process was running on background for too many files which caused java to use CPU more than 100%. when i stopped the build process it cools down and came to normal.

Then I setup a custom build settings for the project from Eclipse IDE menu

Project > Build working set  > Select Working Set

now create a custom build working set and ignore the directory having too many files which you do not need to build then select that New Working Set for the project.

Hope it helps someone.

You must log in to answer this question.

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