This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245771 - Massive performance degeneration with maven project (blocks EDT)
Summary: Massive performance degeneration with maven project (blocks EDT)
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
: 245878 245882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-17 21:08 UTC by matthias42
Modified: 2014-07-28 05:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
pom that was being worked on, when problem occured (2.48 KB, text/xml)
2014-07-17 21:08 UTC, matthias42
Details
profiler snapshot 1 (6.07 KB, application/octet-stream)
2014-07-17 21:10 UTC, matthias42
Details
profiler snapshot 2 (8.93 KB, application/octet-stream)
2014-07-17 21:11 UTC, matthias42
Details
new profiler snapshot showing massive CPU usage in SetMainProject#createSubMenu (6.46 KB, application/octet-stream)
2014-07-20 10:48 UTC, matthias42
Details
Another Profiler Result (17.57 KB, application/octet-stream)
2014-07-21 22:51 UTC, matthias42
Details
CPU spiking after working on POM (114.20 KB, image/png)
2014-07-21 22:52 UTC, matthias42
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matthias42 2014-07-17 21:08:47 UTC
Created attachment 148117 [details]
pom that was being worked on, when problem occured

After chasing some more after bug 245703, I decided to see if the problem is present in head builds. So I did a build from core-main.

Last change according to hg log:

Änderung:        276238:8561dfaf6740
Marke:           tip
Vorgänger:       276225:28273cc589d7
Vorgänger:       276237:22364e3ea611
Nutzer:          ffjre@netbeans.org
Datum:           Thu Jul 17 18:15:10 2014 +0000
Zusammenfassung: Automated merge with main-silver

This build proofed to be unusable. I worked on the redminenb plugin (https://github.com/redminenb/redminenb), trying to merge the two modules of the plugin to one.

I was working in the pom.xml, added some dependencies in the gui, made some manual adjustmends and the netbeans froze. top showed one cpu core completly saturnated by java, jvisualvm showed netbeans as the problem. The frozen state was explainable when viewing the profiler samples - the AWT event dispatching thread is blocked.

I'll attach the pom.xml and two profiler snapshots.

P1 reason: Very bad UI responsiveness making the feature unusable
Comment 1 matthias42 2014-07-17 21:10:53 UTC
Created attachment 148118 [details]
profiler snapshot 1
Comment 2 matthias42 2014-07-17 21:11:25 UTC
Created attachment 148119 [details]
profiler snapshot 2
Comment 3 Tomas Stupka 2014-07-18 10:45:16 UTC
introduced in #32dcd20f096c

looks like on each call of SetMainProject.createSubMenu() there is a new listener registered on each projectinfo which then triggers on e.g. each pom save

Martin, please have a look
Comment 4 Martin Kozeny 2014-07-18 14:23:43 UTC
Hope this helps:
https://hg.netbeans.org/core-main/rev/c01fc4586f73.
If problem persists, feel free to reopen.
Comment 5 matthias42 2014-07-19 10:02:20 UTC
Looks good - I rebuild netbeans and opened two maven projects, worked in the pom, did some changes and saves. I see spikes in CPU usage after save, but that is expected (I'll asume the internal POM model is rebuild and dependencies are recalculated).
Comment 6 matthias42 2014-07-20 10:48:24 UTC
Created attachment 148151 [details]
new profiler snapshot showing massive CPU usage in SetMainProject#createSubMenu

Reopening - the situation is better but not fixed. I managed to get the GUI frozen and I even managed to fire up visualvm in time.

The attached profiler snapshot show the last seconds of the problem. As you can see the EDT is blocked in createSubMenu for a long time. The method looks _very_ expensive to call.
Comment 7 Martin Kozeny 2014-07-21 08:31:43 UTC
Not connected with bug fix #32dcd20f096c. Fix: https://hg.netbeans.org/core-main/rev/ff7de19f9b07.
Comment 8 matthias42 2014-07-21 22:51:26 UTC
Created attachment 148189 [details]
Another Profiler Result

Sorry - but this does not work - netbeans is once again unsable, all my cores are fully occupied working on the netbeans java process. I attached the last sampler snapshot I got from netbeans here, and will provide a screen shot showing CPU usage.

Another comment - your fix moves swing creation/handling outside the EDT - from my understanding of the theory, this is a no-no. From my understanding of the sampler output I would not run after the swing EDT, but have a broader look at the real hotspots (keeping in mind, that I had approx. 3 projects open, the Arrays#sort method is dog slow).
Comment 9 matthias42 2014-07-21 22:52:12 UTC
Created attachment 148190 [details]
CPU spiking after working on POM
Comment 10 Martin Kozeny 2014-07-22 11:57:49 UTC
You're right. Recreated as only menu item name update, not creating whole submenu when project name changed. Profiler shows me no performance problems.

Fix: https://hg.netbeans.org/core-main/rev/666f0eeaec1d.
Comment 11 Martin Kozeny 2014-07-22 19:46:14 UTC
*** Bug 245882 has been marked as a duplicate of this bug. ***
Comment 12 Quality Engineering 2014-07-23 02:07:54 UTC
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c01fc4586f73
User: Martin Kozeny <mkozeny@netbeans.org>
Log: #245771: Massive performance degeneration with maven project (blocks EDT).
Comment 13 Tomas Stupka 2014-07-24 11:32:05 UTC
*** Bug 245878 has been marked as a duplicate of this bug. ***
Comment 14 Martin Kozeny 2014-07-25 12:38:47 UTC
Improved handling with property change listeners: https://hg.netbeans.org/core-main/rev/4d3acde3aa22
Comment 15 Quality Engineering 2014-07-28 05:23:05 UTC
Integrated into 'main-silver', will be available in build *201407280405* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4d3acde3aa22
User: Martin Kozeny <mkozeny@netbeans.org>
Log: #245771: Massive performance degeneration with maven project (blocks EDT) - improved handling with property change listeners.