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 176292 - Frequent OOM when using Maven functions (scanning, query)
Summary: Frequent OOM when using Maven functions (scanning, query)
Status: RESOLVED DUPLICATE of bug 185080
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-09 14:08 UTC by fabriziogiudici
Modified: 2010-07-26 11:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fabriziogiudici 2009-11-09 14:08:18 UTC
I'm seeing frequently OOM errors that I presume are related to Maven operations (also after looking at the log). One happened while NetBeans was reindexing the local Maven repo, another while I was performing a query about a Maven artifact. The memory monitor shows that all the 512MB of RAM are allocated.

SEVERE [org.openide.util.RequestProcessor]
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2786)
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
        at org.apache.lucene.index.FieldsReader.uncompress(FieldsReader.java:583)
        at org.apache.lucene.index.FieldsReader.addField(FieldsReader.java:350)
        at org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:197)
        at org.apache.lucene.index.SegmentReader.document(SegmentReader.java:733)
        at org.apache.lucene.index.IndexReader.document(IndexReader.java:637)
        at org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:91)
        at org.apache.lucene.search.Hits.doc(Hits.java:180)
        at org.sonatype.nexus.index.DefaultSearchEngine.searchFlat(DefaultSearchEngine.java:136)
        at org.sonatype.nexus.index.DefaultSearchEngine.searchFlatPaged(DefaultSearchEngine.java:76)
        at org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImpl.repeatedFlatSearch(NexusRepositoryIndexerImpl.java:338)
        at org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImpl.access$1400(NexusRepositoryIndexerImpl.java:137)
        at org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImpl$17.run(NexusRepositoryIndexerImpl.java:977)
        at org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImpl$17.run(NexusRepositoryIndexerImpl.java:945)
        at org.openide.util.Mutex.writeAccess(Mutex.java:433)
        at org.netbeans.modules.maven.indexer.NexusRepositoryIndexerImpl.find(NexusRepositoryIndexerImpl.java:945)
        at org.netbeans.modules.maven.indexer.api.RepositoryQueries.find(RepositoryQueries.java:349)
[catch] at org.netbeans.modules.maven.nodes.AddDependencyPanel$QueryPanel$1.run(AddDependencyPanel.java:893)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1084)
WARNING [org.netbeans.core.TimableEventQueue]: too much time in AWT thread null
WARNING [org.netbeans.core.TimableEventQueue]: too much time in AWT thread org.netbeans.modules.profiler.actions.SelfSamplerAction$Controller@52925f6d
Comment 1 fabriziogiudici 2009-11-09 14:09:16 UTC
(with 6.8beta).
Comment 2 michaelpigg 2010-04-14 10:51:49 UTC
I'm also seeing OutOfMemoryError errors when indexing the local repo.
Comment 3 michaelpigg 2010-04-21 11:45:18 UTC
The problem I'm seeing is that on a non-trivial local repository, the heap space starts growing almost as soon as the indexing starts and continues growing until it hits the maximum heap size. Shortly after that the out of memory error occurs. While this is happening the IDE is unusable.

I dug into the problem and found that the problem is related to the code in NexusRepositoryIndexerImpl.NbIndexCreator. I think the problem is directly related to creating a MavenProject for every artifact. If I comment out this code, heap memory utilization is normal and indexing completes without error.

Looking at the heap dump, it looks like the problem may be in Maven. On the other hand, I don't know if the code in NbIndexCreator is using Maven correctly.
Comment 4 michaelpigg 2010-04-21 11:48:10 UTC
Also, I see this problem in 6.8 and later, including current source builds.
Comment 5 Milos Kleint 2010-04-21 11:52:08 UTC
I would suggest just dumping the NexusRepositoryIndexerImpl.NbIndexCreator. it's only used by the "find where my artifact is used as dependency" query and indeed does have some performance overhead.
Comment 6 Antonin Nebuzelsky 2010-07-26 11:49:48 UTC
Fixed in 6.9 as issue 185080.

*** This bug has been marked as a duplicate of bug 185080 ***