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 193656 - java.lang.OutOfMemoryError: unable to create new native thread results in NCDFE: parsing.impl.TaskProcessor
Summary: java.lang.OutOfMemoryError: unable to create new native thread results in NCD...
Status: RESOLVED INCOMPLETE
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-20 16:23 UTC by imadbougataya
Modified: 2011-04-15 09:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 164162


Attachments
stacktrace (430 bytes, text/plain)
2010-12-20 16:23 UTC, imadbougataya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description imadbougataya 2010-12-20 16:23:18 UTC
Build: NetBeans IDE 6.9.1 (Build 201011082200)
VM: Java HotSpot(TM) Client VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04
OS: Windows Vista

User Comments:
imadbougataya: Clicked in the editor window of a JFrame




Stacktrace: 
java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.modules.parsing.impl.TaskProcessor
   at org.netbeans.modules.parsing.api.Source$MySourceAccessor.getCache(Source.java:668)
   at org.netbeans.modules.parsing.spi.Scheduler$1.run(Scheduler.java:156)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
   at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
Comment 1 imadbougataya 2010-12-20 16:23:23 UTC
Created attachment 104319 [details]
stacktrace
Comment 2 Jaroslav Tulach 2011-04-14 10:50:48 UTC
http://statistics.netbeans.org/exceptions/exception.do?id=456171

java.lang.OutOfMemoryError: unable to create new native thread
	at java.lang.Thread.start0(Native Method)
	at java.lang.Thread.start(Thread.java:640)
	at java.util.concurrent.ThreadPoolExecutor.addIfUnderCorePoolSize(ThreadPoolExecutor.java:703)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:652)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:78)
	at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:600)
	at org.netbeans.modules.parsing.impl.TaskProcessor.<clinit>(TaskProcessor.java:144)
	at org.netbeans.modules.parsing.impl.Utilities.scheduleSpecialTask(Utilities.java:98)
Comment 3 Tomas Zezula 2011-04-15 09:29:53 UTC
Not editor.parsingapi issue at all.
The root case of the NoClassDefFoundError is:

java.lang.OutOfMemoryError: unable to create new native thread from 

As the TaskProcessor is a core parsing.api class (it's loaded before the parsing api is used => parsing api was not active yet). The TaskProcessor cannot be loaded because in <cinit> it creates t thread which cannot be allocated dou to OOM. Moving the thread creating from <cinit> to method will not help, the OOM will immediately follow. There are two possible reasons of the OOM:

1st) There is high number of created threads (has to be created by some module lower than parsing api as it's not yet active). Each thread reserves a heap. When there is not enough space to reserve an OOM is thrown.

2nd) Memory leak (also in module under parsingapi).

It's hard to saw which one is true without heap dump or at least histogram and thread dump.
Can you attach them?

Thanks