Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 71677

Summary: exception during refresh prevents startup after crash
Product: [Eclipse Project] Platform Reporter: Jason Rogers <jason>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: eduard, mkwong
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Log with error stack in it
none
.metadata directory TARed and BZIPed none

Description Jason Rogers CLA 2004-08-09 16:17:38 EDT
After starting a search Eclipse ran out of memory and crashed.  Now I can't 
start Eclipse at all.  Here are a few lines from the log file:!ENTRY org.
eclipse.core.runtime 4 2 Aug 09, 2004 15:44:26.204
!MESSAGE An internal error occurred during: "Java Search".
!STACK 0
java.lang.OutOfMemoryError

!ENTRY org.eclipse.ui 4 4 Aug 09, 2004 15:44:26.376
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Aug 09, 2004 15:44:26.376
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError
!SESSION Aug 09, 2004 15:46:01.68 ----------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -Xms10M -Xmx25M

!ENTRY org.eclipse.osgi Aug 09, 2004 15:46:01.69
!MESSAGE An error occured while automatically activating bundle org.eclipse.
core.resources (67).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.
compatibility.PluginActivator.start() of bundle org.eclipse.core.resources.

The error I get in the log when I try to restart is:
!ENTRY org.eclipse.core.runtime 4 2 Aug 09, 2004 15:44:26.204
!MESSAGE An internal error occurred during: "Java Search".
!STACK 0
java.lang.OutOfMemoryError

!ENTRY org.eclipse.ui 4 4 Aug 09, 2004 15:44:26.376
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Aug 09, 2004 15:44:26.376
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError
!SESSION Aug 09, 2004 15:46:01.68 ----------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -Xms10M -Xmx25M

!ENTRY org.eclipse.osgi Aug 09, 2004 15:46:01.69
!MESSAGE An error occured while automatically activating bundle org.eclipse.
core.resources (67).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.
compatibility.PluginActivator.start() of bundle org.eclipse.core.resources.
Comment 1 Jason Rogers CLA 2004-08-09 16:22:41 EDT
Created attachment 13833 [details]
Log with error stack in it

Sorry, I miscopied the second error in the original post.  I am attaching the
log that has only the errors from trying to restart.
Comment 2 Jason Rogers CLA 2004-08-09 17:22:10 EDT
Well, I backed up my current workspace, untarred a backup from 1:00AM today and 
everything is working.  I had to copy over my changed files from the "corrupt" 
workspace (which was a hassle) but at least I am back in business.  I am 
therefore changing the severity of the bug from "blocker" to "major".
Comment 3 Olivier Thomann CLA 2004-08-09 22:59:05 EDT
Move to Platform/Runtime
Comment 4 Jason Rogers CLA 2004-08-12 10:59:33 EDT
This has just happened again.  Same error, different cause.  This time Eclipse 
locked up on me and I shut it down forcefully.
Comment 5 Pascal Rapicault CLA 2004-08-16 16:56:32 EDT
Something strange seems to have happened to your workspace.
Moving to resources for comment.
Comment 6 Jason Rogers CLA 2004-08-16 17:22:05 EDT
Yes, something strange did happen to the workspace.  My point in posting the bug 
was to find out what.  It seems to me that after such shutdowns 
(OutOfMemoryCrash in one instance, ForcedShutdownAfterHang in another instance) 
you should /still/ be able to restart Eclipse.  The errors in the log may be 
misleading, but if they aren't it sounds like a classpath issue.  I don't know 
why an unexpected shutdown would cause classpath problems.
Comment 7 Jason Rogers CLA 2004-08-18 15:32:11 EDT
OK, now this is getting ridiculous.  I wonder if it has something to do with the 
plugins I have installed.  I am experiencing the same behavior today.  This 
time, Eclipse popped up the OutOfMemory dialog and gave me the choice to close 
the workbench or not.  I decided not to close, got out of the dialog box, then 
closed Eclipse manually.  When I restart I get the same error.
Comment 8 DJ Houghton CLA 2004-08-18 17:47:28 EDT
You are correct, no matter how you crashed you should be able to start Eclispe
again.

How big is your workspace? Are you able to zip it and send it to us? 

Note that in your command-line arg you are probably getting the OutofMemory
because of the -Xmx25M. Did you mean to type "256M" instead?
Comment 9 Jason Rogers CLA 2004-08-18 17:53:11 EDT
The commandline is actually:
   /opt/eclipse/gtk/3.0Final/eclipse -data /home/jrogers/workspace -vmargs 
-Xmx96M -Xverify:none -XX:+UseParallelGC -XX:PermSize=20M -XX:MaxNewSize=32M 
-XX:NewSize=32M -Xms64m

I up'ed the -Xmx after the first crash.

As far as the size of the workspace, it is pretty large.  I TARed and GZIPed the 
.metadata directory and it is 7.3MB.  I can attach it if you would like.
Comment 10 DJ Houghton CLA 2004-08-19 11:41:20 EDT
Can you delete \.metadata\.plugins\org.eclipse.core.resources\.history before
attaching? (just contains local history)

Unfortuanatly with crashes the interesting thing is "how did we get in this
state?" and its hard to figure that out since it already happened. But I can try
to set up a new workspace with your .metadata and go from there...
Comment 11 Jason Rogers CLA 2004-08-19 15:31:23 EDT
I removed .metadata/.plugins/org.eclipse.core.resources/.history and rearchived 
it, but that only takes it from 7.3MB to 7.2MB.  I ran "du -hc" on .metadata and 
it seems that the most space is contributed by .metadata/.plugins/org.eclipse.
jdt.core, weighing in at 19MB.  There are a bunch of *.index files there (eg. 
71478105.index).  Can I take those out, or do you need them?

Also, I have TARed and BZIPed the directory and gotten it down to 5.3M, so if 
that is acceptable I will attach it.
Comment 12 DJ Houghton CLA 2004-08-19 15:47:36 EDT
Sure, get rid of the index files. 

FYI: I'm away for a week or so (starting tomorrow) so I will not be able to look
at this for a bit. (unless someone else gets a chance while I'm gone)
Comment 13 Jason Rogers CLA 2004-08-19 17:28:57 EDT
Created attachment 14083 [details]
.metadata directory TARed and BZIPed

The .metadata directory has everything from the latest crashed workspace except
for:
  - .metadata/.plugins/org.eclipse.core.resources/.history
  - .metadata/.plugins/org.eclipse.jdt.core/*.index
Comment 14 Jason Rogers CLA 2004-08-19 17:30:15 EDT
Thanks for looking into this.  Enjoy your vacation.
Comment 15 John Arthorne CLA 2005-02-15 14:43:10 EST
*** Bug 57344 has been marked as a duplicate of this bug. ***
Comment 16 Eduard Martinescu CLA 2005-05-23 15:34:54 EDT
I'm also seeing 'OutOfMemory' errors. I have a little more detail however. I 
was debugging a plugin, so I was able to trap the OutOfMemory exception within 
the debugger, and the stack trace in my case is as follows: 
 
Thread [main] (Suspended (exception OutOfMemoryError)) 
	ResourceTransfer.nativeToJava(TransferData) line: 160 
	Clipboard.getContents(Transfer, int) line: 304 
	Clipboard.getContents(Transfer) line: 236 
	PasteAction$1.run() line: 186 
	UISynchronizer(Synchronizer).syncExec(Runnable) line: 147 
	UISynchronizer.syncExec(Runnable) line: 28 
	Display.syncExec(Runnable) line: 3255 
	PasteAction.updateSelection(IStructuredSelection) line: 181 
	
PasteAction(BaseSelectionListenerAction).selectionChanged(IStructuredSelection) 
line: 124 
	RefactorActionGroup.updateActionBars() line: 154 
	MainActionGroup.updateActionBars() line: 315 
	ResourceNavigator.updateActionBars(IStructuredSelection) line: 1206 
	ResourceNavigator.createPartControl(Composite) line: 275 
	ViewReference.createPartHelper() line: 310 
	ViewReference.createPart() line: 185 
	ViewReference(WorkbenchPartReference).getPart(boolean) line: 559 
	WorkbenchPage$ActivationList.setActive(IWorkbenchPartReference) line: 
3399 
	WorkbenchPage.onActivate() line: 2089 
	WorkbenchWindow$5.run() line: 2359 
	BusyIndicator.showWhile(Display, Runnable) line: 69 
	WorkbenchWindow.setActivePage(IWorkbenchPage) line: 2341 
	WorkbenchWindow.busyOpenPage(String, IAdaptable) line: 695 
	Workbench.busyOpenWorkbenchWindow(String, IAdaptable) line: 617 
	Workbench.openFirstTimeWindow() line: 1168 
	WorkbenchConfigurer.openFirstTimeWindow() line: 180 
	IDEWorkbenchAdvisor(WorkbenchAdvisor).openWindows() line: 706 
	Workbench.init(Display) line: 981 
	Workbench.runUI() line: 1541 
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 315 
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 143 
	IDEApplication.run(Object) line: 103 
	PlatformActivator$1.run(Object) line: 230 
	EclipseStarter.run(Object) line: 371 
	EclipseStarter.run(String[], Runnable) line: 160 
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
available [native method] 
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 
	Method.invoke(Object, Object[]) line: 324 
	Main.invokeFramework(String[], URL[]) line: 330 
	Main.basicRun(String[]) line: 274 
	Main.run(String[]) line: 977 
	Main.main(String[]) line: 952 
 
 
The variables are as follows: 
this= ResourceTransfer  (id=46) 
transferData= TransferData  (id=55) 
bytes= byte[25]  (id=58) 
in= DataInputStream  (id=60) 
count= 1869768494 
 
 
That count looks suspicious. 
Comment 17 Rafael Chaves CLA 2005-05-24 11:43:29 EDT
Eduard, your OOM is unrelated to this PR, which is caused by a corrupted file. 

OOMs are not always bugs, it can be just insufficient memory being provided to
the Java VM for the operation being performed. You can use the VM arg
-Xmx<size>m to change the maximum of memory allowed to a Java application (size
in megabytes), for instance:

eclipse [any Eclipse args you might have] -vmargs -Xmx512m
Comment 18 John Arthorne CLA 2005-05-24 14:08:01 EDT
Eduard, I suggest entering a separate bug report against Platform UI in your
case.  I agree the "count" variable looks suspicious.  It looks like the data on
the system clipboard is somehow being corrupted.  In any case, it's unrelated to
this bug.
Comment 19 John Arthorne CLA 2005-05-25 11:27:42 EDT
Updating title to make it clear that not all OutOfMemoryErrors are related. 
Here is the relevant snippet from the log file that caused the startup failure:

java.lang.IllegalArgumentException: Path must include project and resource name:
/Salesforce.com Web Application
	at org.eclipse.core.internal.utils.Assert.isLegal(Assert.java:58)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:1509)
	at
org.eclipse.core.internal.localstore.UnifiedTree.createChildNodeFromFileSystem(UnifiedTree.java:240)
	at
org.eclipse.core.internal.localstore.UnifiedTree.addChildren(UnifiedTree.java:126)
	at
org.eclipse.core.internal.localstore.UnifiedTree.addNodeChildrenToQueue(UnifiedTree.java:204)
	at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:76)
	at
org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:622)
	at
org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:609)
	at
org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshRoot(FileSystemResourceManager.java:653)
	at
org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:602)
	at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1222)
	at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:1608)
Comment 20 Eduard Martinescu CLA 2005-05-25 15:04:17 EDT
(In reply to comment #18) 
 
Ok, created a new bug 96679 
 
Comment 21 John Arthorne CLA 2005-10-17 15:38:51 EDT

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