Bug 1063301 - Ivy local resolution: too many worker threads leading to OOM
Summary: Ivy local resolution: too many worker threads leading to OOM
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xmvn
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mikolaj Izdebski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-10 13:06 UTC by Michael Simacek
Modified: 2014-06-09 02:10 UTC (History)
4 users (show)

Fixed In Version: 2.0.1-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-09 02:10:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Build log (210.99 KB, text/plain)
2014-02-10 13:29 UTC, Michael Simacek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1051536 0 unspecified CLOSED Lucene 4.7.0 is available 2021-02-22 00:41:40 UTC

Internal Links: 1051536

Description Michael Simacek 2014-02-10 13:06:50 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Mikolaj Izdebski 2014-02-10 13:08:32 UTC
I assume you hit submit too soon.
What's the problem?

Comment 2 Michael Simacek 2014-02-10 13:26:48 UTC
Yes, sorry for that.

Description of the problem:
Building complex projects with Ivy with XMvn local resolution leads to OOM error, because it creates too many worker threads. It seems like the depmap resolution worker threads are not properly destroyed. I tried watching the build with thermostat and there was almost one thousand of them.

Steps to reproduce:
Rebuild: http://msimacek.fedorapeople.org/lucene-4.6.1-1.fc20.src.rpm

End of stacktrace:
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:713)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:949)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1360)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132)
at org.fedoraproject.maven.resolver.impl.DepmapReader.readMappings(DepmapReader.java:99)
at org.fedoraproject.maven.resolver.impl.DefaultDependencyMap.initialize(DefaultDependencyMap.java:234)

Comment 3 Michael Simacek 2014-02-10 13:29:07 UTC
Created attachment 861388 [details]
Build log

Comment 4 Mikolaj Izdebski 2014-02-10 13:31:08 UTC
Exactly which version of xmvn did you test?  Which version of apache-ivy? Which version of ivy-local?

Comment 5 Michael Simacek 2014-02-10 14:07:42 UTC
Oh, sorry, it seems like it happens only when running tests and the SRPM had tests disabled. Could you please download it again? (Or just add test as another ant target)

xmvn-1.5.0-0.19.gitcb3a0a6.fc21.noarch
ivy-local-3.5.0-2.fc21.noarch
apache-ivy-2.3.0-9.fc21.noarch

Comment 6 Fedora Admin XMLRPC Client 2014-04-24 12:47:33 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Mikolaj Izdebski 2014-05-12 04:48:03 UTC
Cause: XMvn spawns background threads to initialize some "eager" singletons in order to minimize delay on their first use and improve overall performance.

Consequence: Java allows isolated class realms to have multiple singleton instances, so hundreds of initializer threads may be spawned in applications heavily using isolated realms, such as in unit testing.

Fix: Use lazy initialization instead of eager initialization.

Result: Lower performance, but better worst-case behavior.

Comment 8 Mikolaj Izdebski 2014-06-02 06:22:10 UTC
Fixed upstream in a21439c

Comment 9 Mikolaj Izdebski 2014-06-06 12:03:33 UTC
Fixed in xmvn-2.0.1-1

Comment 10 Mikolaj Izdebski 2014-06-09 02:10:07 UTC
I believe that this bug is fixed in xmvn-2.0.1-1,
which is available in Fedora Rawhide, so I am closing this bug now.

The build containing the fix can be found at Koji:
http://koji.fedoraproject.org/koji/buildinfo?buildID=521513


Note You need to log in before you can comment on or make changes to this bug.