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 176297 - Many RequestProcessor threads created when the master filesystem changes.
Summary: Many RequestProcessor threads created when the master filesystem changes.
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Options&Settings (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-09 14:56 UTC by phil4571
Modified: 2011-11-16 14:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Memory Profile (106.30 KB, image/png)
2010-01-05 12:25 UTC, pouyan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description phil4571 2009-11-09 14:56:31 UTC
When building our application with version 10 of the netbeans platform, calls to the setDelegates() method of MultiFileSystem cause RequestProcessor threads to be created by org.netbeans.modules.options.CategoryModel. With each call to setDelegates(), the number of threads created increases. The threads are named "openide-request-processor-xxx" for some number xxx. These threads can number in the hundreds, and eventually, this leads to an OutOfMemoryError : cannot create new native thread.

At a first glance, it looks as if CategoryModel adds a listener to a particular lookup which never gets removed. As the number of listeners increases, the number of calls to the RequestProcessor, which is implemented as CategoryModel$1, increases also.
Comment 1 Jiri Skrivanek 2009-11-11 03:26:52 UTC
Fixed.
core-main #d11177552bb4
Comment 2 pouyan 2009-11-11 10:57:24 UTC
So will this be available in a development build?  If so, when will that build be ready?

Thanks!
Comment 3 Jiri Skrivanek 2009-11-12 02:23:03 UTC
You will be notified when dev build with this fix is ready. It should be within one or two days.
Comment 4 pouyan 2010-01-05 12:25:28 UTC
Created attachment 93085 [details]
Memory Profile

Two memory profiles, two minutes apart, showing hundreds of megabytes allocated to the CategoryModel objects.
Comment 5 pouyan 2010-01-05 12:29:49 UTC
It seems the threads are being cleaned up properly, but many objects are still being created (see "Memory Profile" screenshot). The side effect of this is that it takes a minimum of 30 seconds (up to several minutes) to open the options panel.

We are using Netbeans Development Harness 091111.
Comment 6 phil4571 2010-01-05 13:07:22 UTC
It seems the old listener is still not being removed in CategoryModel.
Comment 7 pouyan 2010-01-08 14:31:20 UTC
Any news? We are eagerly awaiting this fix. A status update would be greatly appreciated.

Thanks,

Pouyan
Comment 8 pouyan 2010-01-12 12:02:59 UTC
Changed priority to highest in the hopes that somebody will respond.
Comment 9 phil4571 2010-01-12 18:27:48 UTC
Please see line 296 here:

http://hg.netbeans.org/core-main/file/d11177552bb4/options.api/src/org/netbeans/modules/options/CategoryModel.java#l296

The this reference is added as a new listener but never removed from the old lookup. 

Is this the culprit?

When do you estimate this bug will be resolved?
Comment 10 Jiri Rechtacek 2010-02-01 07:22:05 UTC
rev/32486572ed7f
Comment 11 Quality Engineering 2010-02-03 21:44:11 UTC
Integrated into 'main-golden', will be available in build *201002040200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/32486572ed7f
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #176297: Many RequestProcessor threads created when the master filesystem changes.