Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 107051 - "Too many open files" by Install/Update
Summary: "Too many open files" by Install/Update
Status: RESOLVED DUPLICATE of bug 150994
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Update-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-15 13:19 EDT by Konrad Kolosowski CLA
Modified: 2008-08-11 14:35 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konrad Kolosowski CLA 2005-08-15 13:19:14 EDT
I was mirroring eclipse update site (all features), and it completed with 
errors.  The eclipse/configuration.#############.log file contains tens of 
following:

!ENTRY org.eclipse.update.core 4 0 2005-08-15 12:57:06.596
!MESSAGE  [Too many open files]
!STACK 0
java.util.zip.ZipException: Too many open files
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:204)
	at java.util.jar.JarFile.<init>(JarFile.java:132)
	at java.util.jar.JarFile.<init>(JarFile.java:97)
	at org.eclipse.update.core.JarContentReference.asJarFile
(JarContentReference.java:142)
	at org.eclipse.update.core.JarContentReference.peek
(JarContentReference.java:324)
	at 
org.eclipse.update.internal.mirror.MirrorSiteFactory.parseDownloadedPluginsAndF
ragments(MirrorSiteFactory.java:127)
	at org.eclipse.update.internal.mirror.MirrorSiteFactory.createSite
(MirrorSiteFactory.java:79)
	at org.eclipse.update.internal.mirror.MirrorCommand.getMirrorSite
(MirrorCommand.java:124)
	at org.eclipse.update.internal.mirror.MirrorCommand.run
(MirrorCommand.java:56)
	at org.eclipse.update.standalone.ScriptedCommand.run
(ScriptedCommand.java:64)
	at org.eclipse.update.standalone.StandaloneUpdateApplication.run
(StandaloneUpdateApplication.java:47)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)

This was for plug-ins contained in 200-300 features that are on the site.  I 
suppose the problem may be hit for a given version it the product is 
sufficiently large.
Comment 1 Konrad Kolosowski CLA 2005-08-15 15:28:13 EDT
I repeated the mirroring process few more times, but it always hits this 
issue.  Hundreds of java.util.zip.ZipException are logged, so I am unable to 
completely mirror the eclipse updates site.  My local mirror already contains 
contents of eclipse testUpdates, and together with updates it is too much to 
handle.

Looking at the code, ,some access to Jar files is controlled by a class.

JarContentReference class contains a list of all JarFile opened.  The size of 
the list is unbound, and the files are closed only on platform shutdown.

Second problem is that not all reading from Jars occurs using 
JarContentReference.  ContentReference API contains asURL() method that in 
this case returns URL of the form jar:file:..., and some parts of Update code 
open URLs directly using Java APIs.  The OtherResponse class does 
url.openConnection() in case of jar:file: URL.  That obviously presents a 
challenge when to close the files or how to keep track of them.

I think the APIs should not open URLs directly at all.  It would be best if 
they are completely removed from APIs as they are opened to easily.  A 
symbolic equivalent should be introduced that could be implemented only by 
each protocol/transport implementation.  This would ensure that the Response 
classes that already exist in Update would have their Request equivalent and 
both could be use component-wide across update.  Each implementation could 
implement its own caching and recovery strategy, that in the long run would 
eliminate duplicate http connections or too many jar files open.
Comment 2 Konrad Kolosowski CLA 2005-10-25 14:08:48 EDT
I used Sun's VM.
Probably 1.5_04, but I am not sure.
Comment 3 Tim Fletcher CLA 2008-07-25 09:45:56 EDT
Will this bug be addressed in a maintenance release of 3.1? Has it been addressed in versions of Eclipse beyond 3.1?
Comment 4 John Arthorne CLA 2008-08-11 14:35:26 EDT
This was fixed in Eclipse 3.2.1

*** This bug has been marked as a duplicate of bug 150994 ***