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 222823 - IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
Summary: IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
: 221885 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-27 13:39 UTC by augcampos
Modified: 2013-01-18 07:18 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 189786


Attachments
stacktrace (5.25 KB, text/plain)
2012-11-27 13:39 UTC, augcampos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description augcampos 2012-11-27 13:39:17 UTC
Build: NetBeans IDE Dev (Build 201211270002)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.5-b02, Java(TM) SE Runtime Environment, 1.7.0_09-b05
OS: Linux

User Comments:
GUEST: A project was scanning in the background




Stacktrace: 
java.lang.IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
   at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3599)
   at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3588)
   at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3567)
   at org.netbeans.modules.parsing.lucene.LuceneIndex$FlushIndexWriter.callFlush(LuceneIndex.java:1193)
   at org.netbeans.modules.parsing.lucene.LuceneIndex.txStore(LuceneIndex.java:399)
   at org.netbeans.modules.parsing.lucene.DocumentIndexImpl.store(DocumentIndexImpl.java:193)
Comment 1 augcampos 2012-11-27 13:39:20 UTC
Created attachment 128457 [details]
stacktrace
Comment 2 Tomas Zezula 2012-11-28 09:40:30 UTC
In the heapdump there are millions of javascript fields and 152,000+ javascript documents.
How many javascript files do you have in your project?
Comment 3 augcampos 2012-11-28 11:01:56 UTC
Project cloc Statistics
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
PHP                           4557         138931         251362         693012
Javascript                     780          54371         105576         206556
CSS                            402           8147           7020          47513
HTML                           872           5880            971          32590
XML                            437            486            541          18150
XSD                             62           1371           4050          15403
XSLT                            20            445            279           2951
Smarty                          11              3              0            664
SQL                             26            112             60            644
Perl                             2             57             76            535
DTD                              4             38             54            200
Visual Basic                     1             19              0             49
Bourne Shell                     1             12              8             41
Pascal                           2             14             37             25
-------------------------------------------------------------------------------
SUM:                          7177         209886         370034        1018333
-------------------------------------------------------------------------------
Comment 4 Tomas Zezula 2012-11-28 17:46:41 UTC
It's seems to me very suspicious that 780 JS files generates more than 152,000 documents.
Basically there should be 1 to 1 mapping among files and documents.
I will talk about it with someone fro JS tomorrow. Basically I can prevent the OOM in general however the amount of documents is quite horrible compared to number of JS files or even all files.
Comment 5 Tomas Zezula 2012-11-30 08:54:01 UTC
Looking at the snapshot details there are 7 indexers, all of them has some reasonable number of documents in order of thousands (at most 20,000) except of the html indexer which has the rest nearly 100,000 documents.
It's unclear if the documents are generated in several runs or in single run.
I've added injectable request to schedule TX store asynchronously on the indexer, this will help if the documents are created in more runs. If all the documents are created in the single run it will not help and the HTML support needs to be fixed.
Please wait until the changeset propagates into dev build (the message will be added by builder into tis issue) and verify it, thanks.

fixed jet-main 34fdcb2ddf71
Comment 6 Quality Engineering 2012-12-01 02:56:58 UTC
Integrated into 'main-golden', will be available in build *201212010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/34fdcb2ddf71
User: Tomas Zezula <tzezula@netbeans.org>
Log: #222823:IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
Comment 7 Petr Pisl 2012-12-04 13:11:28 UTC
*** Bug 221885 has been marked as a duplicate of this bug. ***
Comment 8 Marian Mirilovic 2013-01-18 07:18:34 UTC
*** Bug 221885 has been marked as a duplicate of this bug. ***