Bug 257545 - "Too many open files" can occur with multiple JavaReconciler threads
Summary: "Too many open files" can occur with multiple JavaReconciler threads
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-12-04 10:43 EST by Bill Joy CLA
Modified: 2010-01-25 06:47 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Joy CLA 2008-12-04 10:43:48 EST
Multiple Java reconciler threads running can lead to UI hang and sometimes thread crashes due to "too many open files" I/O errors.

This is on build M20080911-1700, OS=win32, ARCH=x86, WS=win32, NL=en_US.

I used the "Import Existing Projects into Workspace" wizard and imported one plugin project. My workspace already had over 30 related plugin projects in the workspace. I also had several Java files open (I think that is probably a key point). Build automatically was also enabled.

There was a really long wait with the progress dialog up (I invoked an action which was blocked until the rebuild was complete). I took a thread dump in the console window (I started Eclipse with eclipsec.exe) and saw many  "org.eclipse.jdt.internal.ui.text.JavaReconciler" threads running. My guess is that there was one of these per file that I had open. All these threads were doing zip file operations called by the method JarPackageFragmentRoot.computeChildren().

Suddenly there was exception after exception about "too many open files".

I think part of the problem is related to JavaModelManager which appears to now cache zip file handles on a thread basis. Having multiple reconciler threads running at the same time when there are many JAR files on the classpath of each project would therefore seem dangerous when Windows only has a limited file handle pool.

There are also some major performance implications here that I don't understand.

Guessing from the Error Log entries, there is probably some synchronization between the threads happening since the threads are complaining about the same archive in consecutive entries. Perhaps contention between the threads is part of the performance problem.
Comment 1 Jerome Lanneluc CLA 2008-12-10 12:44:20 EST
In theory, only one JavaReconciler is running at a time (i.e. the reconcile is canceled if it is not the active editor). Would you have a thread dump that shows the problem?
Comment 2 Olivier Thomann CLA 2009-12-09 12:11:02 EST
Closing as WORKSFORME.
No information was provided.
Please reopen if you can provide the requested information.
Comment 3 Ayushman Jain CLA 2010-01-25 06:39:09 EST
Verified for 3.6M5
Comment 4 Srikanth Sankaran CLA 2010-01-25 06:47:52 EST
Verified.