Bug 257167 Shutdown takes too long
I20081127-0900 When I shut down my development workspace (most of the SDK from CVS) after working a few hours with it, I always get a progress dialog that reports "Saving Workspace." for a long time. After a day, it needs about a minute to finish. After working for more than a day, I sometimes have to wait for 3-5 minutes until Eclipse is finally closed. During the delay, I notice heavy disk activity. Stacktraces look like the one below (always in BucketTree.internalAccept(..) inside HistoryStore2.clean(..)). YourKit revealed that most of the time is burnt in - Bucket.load(String, File, boolean) > FileInputStream(File), and in - File.listFiles(). I don't know exactly why this cleanup takes so long, but I would expect that after the "Workspace save interval" from Preferences > General > Workspace (5min), nothing should have to be done any more on shutdown (otherwise, we would also lose that data when the workspace crashes). A problem could be this commented line from HistoryStore2.addState(..): // currentBucket.save(); "ModalContext" prio=6 tid=0x28ee2800 nid=0x964 runnable [0x2a0cf000..0x2a0cfb94] java.lang.Thread.State: RUNNABLE at java.io.WinNTFileSystem.$$YJP$$list(Native Method) at java.io.WinNTFileSystem.list(WinNTFileSystem.java) at java.io.File.list(File.java:973) at java.io.File.listFiles(File.java:1051) at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:102) at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:107) at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:107) at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:107) at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:107) at org.eclipse.core.internal.localstore.BucketTree.internalAccept(BucketTree.java:107) at org.eclipse.core.internal.localstore.BucketTree.accept(BucketTree.java:71) at org.eclipse.core.internal.localstore.HistoryStore2.clean(HistoryStore2.java:155) - locked <0x0eb9b000> (a org.eclipse.core.internal.localstore.HistoryStore2) at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1012) at org.eclipse.core.internal.resources.Workspace.save(Workspace.java:1827) at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor$3.run(IDEWorkbenchAdvisor.java:388) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java
public static String NewFolderDialog_folderNameEmpty;
	public static String NewFolderDialog_progress;
	public static String NewFolderDialog_errorTitle;
	public static String NewFolderDialog_internalError;
	public static String CreateLinkedResourceGroup_linkFileButton;
	public static String CreateLinkedResourceGroup_linkFolderButton;
	public static String CreateLinkedResourceGroup_browseButton;
	public static String CreateLinkedResourceGroup_variablesButton;
	public static String CreateLinkedResourceGroup_resolvedPathLabel;
	public static String CreateLinkedResourceGroup_targetSelectionLabel;
	public static String CreateLinkedResourceGroup_targetSelectionTitle;	
	public static String CreateLinkedResourceGroup_linkTargetNotFile;
	public static String CreateLinkedResourceGroup_linkTargetNotFolder;
	public static String CreateLinkedResourceGroup_linkTargetNonExistent;
	public static String CreateLinkedResourceGroup_unableToValidateLinkTarget;
	public static String PathVariablesBlock_variablesLabel;
	public static String PathVariablesBlock_addVariableButton;
	public static String PathVariablesBlock_editVariableButton;
	public static String PathVariablesBlock_removeVariableButton;
	public static String PathVariableSelectionDialog_title;
	public static String PathVariableSelectionDialog_extendButton;
	public static String PathVariableSelectionDialog_ExtensionDialog_title;
	public static String PathVariableSelectionDialog_ExtensionDialog_description;
	
	
	
	public static String EditorManager_saveResourcesMessage;
	public static String EditorManager_saveResourcesTitle;
	public static String OpenSystemEditorAction_dialogTitle;
	public static String OpenSystemEditorAction_text;