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 256545 - Import library takes very long / causes IDE hang
Summary: Import library takes very long / causes IDE hang
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 8.1
Hardware: PC Other
: P1 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-12 11:02 UTC by bolsover
Modified: 2015-11-20 11:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
threaddump (33.23 KB, text/plain)
2015-11-12 11:02 UTC, bolsover
Details
SelfSampler capture of library import (787.24 KB, application/octet-stream)
2015-11-13 16:35 UTC, bolsover
Details
SelfSampler capture of steady state (11.10 KB, application/octet-stream)
2015-11-13 16:36 UTC, bolsover
Details
IDE Log (479.10 KB, application/octet-stream)
2015-11-13 16:37 UTC, bolsover
Details
possible patch in hg (1.63 KB, patch)
2015-11-13 19:10 UTC, Ondrej Vrabec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bolsover 2015-11-12 11:02:36 UTC
Created attachment 157301 [details]
threaddump

I have an Java Ant project that stores libraries in a dedicated folder.

Attempting to import a library using the Project Properties | Libraries | Add Library | Import function is taking so long (more than 1 hour) that it appears to cause the IDE to hang.

I've attached a threaddump that suggests Hg may be a contributory factor.

Flagging this a a P1 since this issue is preventing development of an existing project.
Comment 1 bolsover 2015-11-12 11:03:21 UTC
Ssytem is:
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b17
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b17
System: Windows 10 version 10.0 running on amd64; Cp1252; en_GB (nb)
Comment 2 Tomas Stupka 2015-11-13 14:43:51 UTC
please reproduce the problem and create and attach a selfprofile snapshot
(see also http://wiki.netbeans.org/FaqProfileMeNow)

reassigning for further evaluation
Comment 3 Ondrej Vrabec 2015-11-13 15:41:41 UTC
@reporter: check the running hg command, you're on mac so "ps -ef | grep hg" should show the running command. If it's still the same, then it's likely your hg installation is corrupted. Try killing the hg command and running it in CLI manually, does it have any output?


@tomas stupka: primarily, projects should not touch I/O in AWT:
	at org.netbeans.modules.project.ant.ProjectLibraryProvider.copyFolderRecursively(ProjectLibraryProvider.java:1358)
	at org.netbeans.modules.project.ant.ProjectLibraryProvider.copyLibrary(ProjectLibraryProvider.java:1280)
	at org.netbeans.spi.project.support.ant.ReferenceHelper.copyLibrary(ReferenceHelper.java:1583)
	at org.netbeans.spi.project.support.ant.ui.CustomizerUtilities$2.importLibrary(CustomizerUtilities.java:109)

should be run in a background thread, do you agree?
Comment 4 bolsover 2015-11-13 16:29:54 UTC
(In reply to Ondrej Vrabec from comment #3)
> @reporter: check the running hg command, you're on mac so "ps -ef | grep hg"
> should show the running command. If it's still the same, then it's likely
> your hg installation is corrupted. Try killing the hg command and running it
> in CLI manually, does it have any output?
> 
> 
> @tomas stupka: primarily, projects should not touch I/O in AWT:
> 	at
> org.netbeans.modules.project.ant.ProjectLibraryProvider.
> copyFolderRecursively(ProjectLibraryProvider.java:1358)
> 	at
> org.netbeans.modules.project.ant.ProjectLibraryProvider.
> copyLibrary(ProjectLibraryProvider.java:1280)
> 	at
> org.netbeans.spi.project.support.ant.ReferenceHelper.
> copyLibrary(ReferenceHelper.java:1583)
> 	at
> org.netbeans.spi.project.support.ant.ui.CustomizerUtilities$2.
> importLibrary(CustomizerUtilities.java:109)
> 
> should be run in a background thread, do you agree?

@Ondrej Vrabec
I'm using Windows 10 not Mac.
Comment 5 bolsover 2015-11-13 16:35:12 UTC
(In reply to Ondrej Vrabec from comment #3)
> @reporter: check the running hg command, you're on mac so "ps -ef | grep hg"
> should show the running command. If it's still the same, then it's likely
> your hg installation is corrupted. Try killing the hg command and running it
> in CLI manually, does it have any output?
> 
> 
> @tomas stupka: primarily, projects should not touch I/O in AWT:
> 	at
> org.netbeans.modules.project.ant.ProjectLibraryProvider.
> copyFolderRecursively(ProjectLibraryProvider.java:1358)
> 	at
> org.netbeans.modules.project.ant.ProjectLibraryProvider.
> copyLibrary(ProjectLibraryProvider.java:1280)
> 	at
> org.netbeans.spi.project.support.ant.ReferenceHelper.
> copyLibrary(ReferenceHelper.java:1583)
> 	at
> org.netbeans.spi.project.support.ant.ui.CustomizerUtilities$2.
> importLibrary(CustomizerUtilities.java:109)
> 
> should be run in a background thread, do you agree?

@Ondrej Vrabec
I'm using Windows 10 not Mac.

(In reply to Tomas Stupka from comment #2)
> please reproduce the problem and create and attach a selfprofile snapshot
> (see also http://wiki.netbeans.org/FaqProfileMeNow)
> 
> reassigning for further evaluation

@Tomas Stupka
As requested I'm attaching copies of the selefsampler files and IDE log.
For information, the library import is an update of an existing Hibernate Library - moving from hiberante-release-4.3.1 to 5.0.3. So it's a sizeable library. I estimate that at second attempt, the import took about 35 minutes.

db
Comment 6 bolsover 2015-11-13 16:35:57 UTC
Created attachment 157330 [details]
SelfSampler capture of library import
Comment 7 bolsover 2015-11-13 16:36:25 UTC
Created attachment 157331 [details]
SelfSampler capture of steady state
Comment 8 bolsover 2015-11-13 16:37:16 UTC
Created attachment 157332 [details]
IDE Log
Comment 9 Tomas Stupka 2015-11-13 16:44:04 UTC
> @tomas stupka: primarily, projects should not touch I/O in AWT:
> should be run in a background thread, do you agree?
indeed! that should be fixed in projects one way or another
Comment 10 Ondrej Vrabec 2015-11-13 18:09:52 UTC
> I'm using Windows 10 not Mac.
Sorry, must have overlooked.
Do you have any other problem with Mercurial support besides this? Do you really use Mercurial as your project VCS?
Comment 11 Ondrej Vrabec 2015-11-13 19:10:43 UTC
Created attachment 157333 [details]
possible patch in hg
Comment 12 bolsover 2015-11-13 22:41:17 UTC
@Ondrej Vrabec

I don't have any other Mercurial problems. I don't generally use the Mercurial support within NB but prefer to use TortoiseHg. 

I've been using Mercurial for a couple of years - use it for all my projects partly becasue it gives me change history and partly because I can use a default push to make sure everything is backed up.

I don't usually use projects with dedicated library folders but did so in this case because I need to share the code with my client and it seemed like a good way of ensuring we build using exactly the same libraries.

db
Comment 13 Tomas Stupka 2015-11-16 14:54:30 UTC
moved the import outside from awt
jet-main #c3c9d06db70e

what stays open is why the action by itself takes so long 

@bolsover - could you please verify how big the imported hibernate library folder is and how many files/directories it contains?
Comment 14 bolsover 2015-11-16 16:00:44 UTC
@ Tomas Stupka

hibernate-release-5.0.3 library is 199MB, 15,252 Files, 1,642 Folders
Comment 15 Quality Engineering 2015-11-17 02:32:26 UTC
Integrated into 'main-silver', will be available in build *201511170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c3c9d06db70e
User: Tomas Stupka <tstupka@netbeans.org>
Log: issue #256545 - Import library takes very long / causes IDE hang
invoke library import outside of awt
Comment 16 Ondrej Vrabec 2015-11-18 18:58:17 UTC
applying the patch - the patch detaches direct calls to hg status and rather ask the cache. The information may not be 100% accurate but is definitely faster.

fixed: core-main #c59fb0a984c7
Comment 17 bolsover 2015-11-19 09:02:55 UTC
Product Version: NetBeans IDE Dev (Build 201511180002)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b17
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b17
System: Windows 10 version 10.0 running on amd64; Cp1252; en_GB (nb)

I've just been testing against above - the updates do appear to improve the user experience somewhat but I regret this is no silver bullet. 

The essential task is one of copying files - it should be MUCH faster - can I reopen?
Comment 18 Quality Engineering 2015-11-20 02:28:37 UTC
Integrated into 'main-silver', will be available in build *201511200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c59fb0a984c7
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #256545 - Import library takes very long / causes IDE hang
Comment 19 bolsover 2015-11-20 11:42:11 UTC
Product Version: NetBeans IDE Dev (Build 201511200002)
Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b17
Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b17
System: Windows 10 version 10.0 running on amd64; Cp1252; en_GB (nb)

Very subjective - but there does appear to be a good improvement when importing libraries using above version.

Agree this should be marked resolved, fixed.

Keep up the excellent work.

db