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 39014 - ParsingSupport misues RequestProcessor
Summary: ParsingSupport misues RequestProcessor
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2004-01-20 16:56 UTC by Petr Nejedly
Modified: 2007-09-26 09:14 UTC (History)
2 users (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 Petr Nejedly 2004-01-20 16:56:58 UTC
ParsingSupport posts its parsing requests into
default (multithreaded, limit of 50 concurent
threads) RequestProcessor, which causes parallel
parsing and allocation of big number of threads
during opening Java files.
(e.g. during startup)

Steps to reproduce: Select several java files and
open them at once. After few seconds do a thread
dump and watch for Inactive RP's (which reveal
their last client in the thread name).

Possible fix:
AFAIK the parser is singlethreaded anyway,
so create a private instance of single threaded RP
and post the requests into it instead of RP.getDefault
Comment 1 Jan Pokorsky 2004-01-20 18:59:34 UTC
ParsingSupport posts parsing requests not into the default RP but into
own RP "Java source parsing". That RP is single threaded so I do not
think here is the problem.

Flood of threads seems to be created by the event model. Each parser
event notification is scheduled into the default RP. So I will
introduce new RP "Java Parser Event Queue" handling these events.
Comment 2 Jan Pokorsky 2004-01-21 15:25:33 UTC
fixed in

/cvs/java/src/org/netbeans/modules/java/parser/ParsingSupport.java,v1.41
Comment 3 ehucka 2004-02-19 12:00:31 UTC
There are one or two Inactive RP threads of ParsingSupport a few
seconds after opening files. All of them are removed after GC. Is this
right behaviour?
Comment 4 Petr Nejedly 2004-02-19 15:47:09 UTC
This is right. They are private to java (i.e. they are not annotated
as 'Default RP') and they are single-threaded, so no thread flooding
and parallel parsing occurs.
Verifying.