Bug 560766 - CPU 100% during maven build
Summary: CPU 100% during maven build
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.14   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-04 08:02 EST by David Balažic CLA
Modified: 2023-03-15 14:07 EDT (History)
3 users (show)

See Also:


Attachments
two stack traces for high CPU load (18.04 KB, application/x-zip-compressed)
2020-03-04 12:31 EST, David Balažic CLA
no flags Details
screenshot of dialog (7.41 KB, image/png)
2020-04-04 09:48 EDT, David Balažic CLA
no flags Details
thread dump (64.40 KB, text/plain)
2023-03-14 08:34 EDT, David Balažic CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Balažic CLA 2020-03-04 08:02:18 EST
I installed eclipse-jee-2019-12-R-win32-x86_64 (build id below)
as I did with previous versions, recreated my workspace and then Eclipse (almost) froze.
One thread used 100% of a CPU core and everything was orders of magnitude slower than normal.

A quick check revealed that it is a memory (over)usage problem.


So please, either:
 - reduce memory usage to normal (as it was in older versions)
 - increase the default -Xmx option value in eclipse.ini to something like 2GB

As the first option is utopic I suggest implementing the second solution.




Eclipse IDE for Enterprise Java Developers.

Version: 2019-12 (4.14.0)
Build id: 20191212-1212
Comment 1 David Balažic CLA 2020-03-04 08:03:35 EST
Additional note: after increasing the Xmx parameter and restarting Eclipse, the problem was gone (well, except the gargantuan RAM consumption, but I have many gigabytes...)
Comment 2 David Balažic CLA 2020-03-04 09:14:50 EST
Upon more inspection, the problem does not seem to be memory related.

Sorry for false alert.

What happened is:
 - download and extract eclipse-jee-2019-12-R-win32-x86_64.zip
 - add to eclipse.ini: -vm C:/Program Files/Java/jdk-11.0.6/bin/server/jvm.dll
 - start Eclipse
 - install plugin: Subclipse 4.3.0 with JavaHL 1.11.1
 - checkout 5 (related) projects from SVN
 - select all 5 and in context menu select: Configure / Convert to Maven project

After a while the Progress view shows a lot of entries named "Processing Build Path changes (Waiting)" 17 pieces and 3 times "JPA Project Change Event Handler (Waiting)".

There is 12% CPU load (I have 4 cores x 2 SMT, so that is one fully loaded thread)- CPU is Intel i7-6820HQ

After waiting for roughly 30 minutes I closed Eclipse (took about a minute).

Then I increased Xmx to 3072m and reopened Eclipse and continued work, with no issues.

Later I checked out some more project from SVN (to same workspace) and after clicking Configure / Convert to Maven project, the same problem happened: 100% load in one thread and the same items in Progress.

It is still running, so any debug ideas are welcome.
Comment 3 Rolf Theunissen CLA 2020-03-04 10:43:59 EST
Can you create a stack trace when the problem occurs, so that it can be further investigated?

https://wiki.eclipse.org/How_to_report_a_deadlock
Comment 4 David Balažic CLA 2020-03-04 12:31:48 EST
Created attachment 282008 [details]
two stack traces for high CPU load

I uploaded 3 stack traces:
 -  one earlier, during the build process
 -  one later, when the build is finished (according to the maven console)
 - and one when closing Eclipse, when the GUI window is already gone, but the process is still running

I used jstack, as I have JDK 11 that has no jvisualvm.
Comment 5 Rolf Theunissen CLA 2020-03-05 04:47:11 EST
Seems to me that the JobManager is overloaded, reassigning to Platform Runtime, they might have a better clue.
Comment 6 Andrey Loskutov CLA 2020-03-05 15:58:32 EST
I believe I've seen this some years ago, that was or is Subclipse bug where it creates gazillions of jobs for refreshing after SVN updates. It created so many jobs, that we had even OOM due the max threads limit hit on Linux (around 4000). 

I believe even to patched that somewhere, or at least posted the patch proposal. If that is not merged, it is probably still somewhere in bugzilla. But isn't Subclipse dead?
Comment 7 Andrey Loskutov CLA 2020-03-05 16:06:13 EST
Bug 489143 was it, but that should have been fixed.
Comment 8 Rolf Theunissen CLA 2020-03-06 03:07:24 EST
It might be that in this case M2Eclipse is creating the huge number of jobs.

David, how many Maven modules does your checkout contain?
Comment 9 David Balažic CLA 2020-03-06 08:45:09 EST
(In reply to Andrey Loskutov from comment #6)
> But isn't Subclipse dead?
Apparently not. What else should I use? I'm aware of Subversive and I used both, but they both have their set of bugs, so I settled with Subclipse, especially after they fixed some of the most annoying bugs.


(In reply to Rolf Theunissen from comment #8)
> David, how many Maven modules does your checkout contain?

Four.

The fifth project just "bundles" those four, the pom.xml is just a <modules> element with 4 <module> children.
Comment 10 Rolf Theunissen CLA 2020-04-04 04:07:15 EDT
To try to find where all the jobs come from, can you enable job tracing?

To enable debugging:
1. Create a file .options in the Eclipse install directory with this contents:
     org.eclipse.core.jobs/jobs=true
2. Start Eclipse with the -debug parameter

This will create a trace.log file in the .metadata directory, with tracing about the jobs created. This should help in identifying which jobs are scheduled and by with plugin.
Comment 11 David Balažic CLA 2020-04-04 09:48:51 EDT
Created attachment 282336 [details]
screenshot of dialog

I did that and suddenly I got this error dialog: Missing node.js
(see screenshot)

I never saw it before.
Comment 12 Rolf Theunissen CLA 2020-04-04 10:38:41 EDT
Kind of strange that you get the error now, but there have been other unexpected interactions when enabling the logging.

Could you be suffering for Bug 386171 (which seems not to be fixed or re-appeared)?
Comment 13 David Balažic CLA 2020-04-04 11:00:34 EDT
Don't know. There are too many comments to read.
Comment 14 David Balažic CLA 2020-09-22 19:33:57 EDT
TLDR: see last paragraph

I now tried eclipse-jee-2020-09-R-win32-x86_64 and got the same issue.


  Eclipse IDE for Enterprise Java Developers (includes Incubating components)
  
  Version: 2020-09 (4.17.0)
  Build id: 20200910-1200

java.version=11.0.8


Steps:
 - unzip Eclipse
 - start it, create new workspace
 - install Subclipse (version 4.3.0, with JavaHL 1.14.0)
 - when asked restart Eclipse
 - open "SVN Repository Exploring" perspective
 - add a SVN repo
 - browse and select 5 projects and check them out
 - in Java EE perspective, view Project Explorer, select all projects and in right click menu select Configure / Convert to Maven project


The same high CPU load happened and Eclipse GUI was very slow. After exiting, the Eclipse window disappeared, but the process was still running for several minutes, then I killer it (from Task Manager / End Task).


Then I rerun Eclipse with the .options file and -debug parameter and a new workspace, but there the problem did not happen (or was not so intense).

So I renamed the install folder, extracted eclipse again (into same pathname), added the .options file and repeated the above steps. This time the seemed to not be as severe as at first, but now I have logs.
After the maven build ended, the message "JPA Project Change Event Handler" kept appearing in the status bar (bottom of the Eclipse window). When I exited Eclipse, it took a while.

Lastly, I extracted again eclipse to a new folder (different path as before), and run it with the .options file and -debug option. This time the problem occurred in "full size".
As the logs contains some private info, I don't want to post them publicly. Is there some private way to share them with developers? Alternatively I can to "anonymize" them.
Comment 15 David Balažic CLA 2023-03-14 08:25:14 EDT
I just got the same issue again with eclipse-jee-2022-12-R-win32-x86_64.zip , about menu says:

Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)

Version: 2022-12 (4.26.0)
Build id: 20221201-1913



Steps:


Steps:
 - unzip Eclipse
 - start it, create new workspace
 - install Subclipse (version 4.3.3, with JavaHL 1.14.0)
 - when asked restart Eclipse
 - open "SVN Repository Exploring" perspective
 - add a SVN repo
 - browse and select 15 projects and check them out
 - in Java EE perspective, view Project Explorer, select all those projects and in right click menu select Configure / Convert to Maven project




(In reply to Rolf Theunissen from comment #10)
> To try to find where all the jobs come from, can you enable job tracing?

Still interested in a job trace?
Comment 16 Andrey Loskutov CLA 2023-03-14 08:27:14 EDT
> Still interested in a job trace?

This bug report doesn't make sense without *thread dump* which you can create via jstack <java process id>.
Comment 17 David Balažic CLA 2023-03-14 08:34:18 EDT
Created attachment 288999 [details]
thread dump

(In reply to Andrey Loskutov from comment #16)
> > Still interested in a job trace?
> 
> This bug report doesn't make sense without *thread dump* which you can
> create via jstack <java process id>.

Attached.
Comment 18 David Balažic CLA 2023-03-15 14:07:28 EDT
A day later thing returned to normal: the Progress view show "No operations to display at this time."

Everything appears to be normal.