Bug 511338 - UI freeze or 3s in LaunchManager.createInfoFromXML
Summary: UI freeze or 3s in LaunchManager.createInfoFromXML
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.14 M3   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 550136 550209
  Show dependency tree
 
Reported: 2017-01-30 16:54 EST by Sergey Prigogin CLA
Modified: 2019-11-15 14:58 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2017-01-30 16:54:46 EST
Here is a typical stack trace of the freeze:
Stack Trace
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.createReader(XMLEntityManager.java:2363)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:694)
	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
	at org.eclipse.debug.internal.core.LaunchManager.createInfoFromXML(LaunchManager.java:953)
	at org.eclipse.debug.internal.core.LaunchManager.getInfo(LaunchManager.java:1371)
	at org.eclipse.debug.internal.core.LaunchConfiguration.getInfo(LaunchConfiguration.java:470)
	at org.eclipse.debug.internal.core.LaunchConfiguration.getType(LaunchConfiguration.java:640)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.getLaunchConfigurations(LaunchConfigurationManager.java:597)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.restoreHistory(LaunchConfigurationManager.java:560)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.restoreLaunchHistory(LaunchConfigurationManager.java:538)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.loadLaunchHistories(LaunchConfigurationManager.java:1066)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.getLaunchHistory(LaunchConfigurationManager.java:1038)
	at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.internalGetHistory(AbstractLaunchHistoryAction.java:547)
	at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.getToolTip(AbstractLaunchHistoryAction.java:233)
	at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.updateTooltip(AbstractLaunchHistoryAction.java:198)
	at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.initialize(AbstractLaunchHistoryAction.java:168)
	at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.selectionChanged(AbstractLaunchHistoryAction.java:513)
	at org.eclipse.ui.internal.PluginAction.refreshEnablement(PluginAction.java:206)
	at org.eclipse.ui.internal.PluginAction.createDelegate(PluginAction.java:126)
	at org.eclipse.ui.internal.WWinPluginAction.refreshActionList(WWinPluginAction.java:158)
	at org.eclipse.ui.plugin.AbstractUIPlugin.lambda$0(AbstractUIPlugin.java:481)
	at org.eclipse.ui.plugin.AbstractUIPlugin$$Lambda$56/1476479463.run(Unknown Source)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4468)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4081)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1133)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:684)
	at org.eclipse.ui.internal.Workbench$$Lambda$14/1820355723.run(Unknown Source)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

Too much work is apparently being done on the UI thread. There shouldn't be a need to do that much on the UI thread since the work is already done asynchronously.
Comment 1 Sarika Sinha CLA 2017-01-30 22:59:30 EST
LaunchConfiguration.getInfo is invoked from many places, needs more analysis before changing it.
Comment 2 Sergey Prigogin CLA 2017-01-30 23:02:08 EST
(In reply to Sarika Sinha from comment #1)
> LaunchConfiguration.getInfo is invoked from many places, needs more analysis
> before changing it.

Doesn't the stack trace provide enough context?
Comment 3 Sarika Sinha CLA 2017-01-30 23:56:58 EST
getInfo method is invoked in many scenarios(not only while getting history), we need to examine all of them.
Comment 4 Sergey Prigogin CLA 2017-01-31 00:30:30 EST
(In reply to Sarika Sinha from comment #3)
> getInfo method is invoked in many scenarios(not only while getting history),
> we need to examine all of them.

Why not address this specific scenario (AbstractLaunchHistoryAction.selectionChanged) first and worry about other scenarios later?
Comment 5 Sarika Sinha CLA 2017-05-19 02:03:18 EDT
Will look into this in 4.8
Comment 6 Sarika Sinha CLA 2018-04-13 02:49:38 EDT
Will not be able to take this up.
Comment 7 Karsten Thoms CLA 2019-11-14 07:17:59 EST
The tooltip update does not need to run within the UI thread. Thus getting the tooltip text and setting it for the action can be done in a background thread. This will make AbstractLaunchHistoryAction.initialize() complete fast without blocking the UI while just getting a tooltip text.
Comment 8 Eclipse Genie CLA 2019-11-14 07:25:11 EST
New Gerrit change created: https://git.eclipse.org/r/152662
Comment 10 Karsten Thoms CLA 2019-11-15 14:58:36 EST
Affects also startup time, since the actions are initialized during startup.