Bug 577744 - Regular UI freezes of 50s to 236s while debugging
Summary: Regular UI freezes of 50s to 236s while debugging
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.21   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-10 09:23 EST by Kevin Bourgault CLA
Modified: 2022-06-03 12:33 EDT (History)
2 users (show)

See Also:


Attachments
Long UI Freeze exports from Error Log (777.14 KB, application/zip)
2021-12-10 09:23 EST, Kevin Bourgault CLA
no flags Details
stack dump (30.90 KB, text/plain)
2022-06-02 03:04 EDT, Florian Kolbe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Bourgault CLA 2021-12-10 09:23:50 EST
Created attachment 287660 [details]
Long UI Freeze exports from Error Log

I constantly experience very long UI freezes while debugging.

It seems to occur most often when eclipse stops at a (java) breakpoint in a method that is called from a lambda - in this case, the UI will almost always freeze for 50+ seconds before showing the call stack, variables, or even the class the breakpoint is in.

After a fresh launch of eclipse, these breakpoints often work without UI freezes for some period of time (minutes or even hours).  But the longer eclipse runs, the more prevalent and longer the UI freezes become.
My eclipse.ini uses these memory settings:
-Xms256m
-Xmx2048m
The freezes occur more frequently when the taskbar shows that eclipse is using more memory, but we're talking in the 800m+ range, not maxed out.

I think this has been occurring for a long time, across several eclipse releases, and it's getting worse (freezes getting more frequent and longer with each release)
I recreated my workspace from scratch a few months ago, but that made no difference.
I'm running Linux Mint 19.3, fully patched, on a core i7-2600 with 32GB of system ram.

I've exported a lot of entries from the Error Log (zipped, attached)
Comment 1 Andrey Loskutov CLA 2021-12-10 09:34:09 EST
You seem to suffer from some webtools editor trying to show/maintain some annotations, probably lot of them.

In general, I would suggest to increase your Eclipse heap to at least 4 GB, I would not recommend to use 2 GB in productive environment to anyone.

Typical stacks:

Thread 'main' tid=1 (RUNNABLE)
!STACK 0
Stack Trace
	at java.base@15.0.2/java.util.HashMap.hash(HashMap.java:340)
	at java.base@15.0.2/java.util.HashMap.getNode(HashMap.java:570)
	at java.base@15.0.2/java.util.HashMap.get(HashMap.java:558)
	at org.eclipse.jface.text.source.AnnotationMap.get(AnnotationMap.java:100)
	at org.eclipse.jface.text.source.AnnotationMap.get(AnnotationMap.java:1)
	at org.eclipse.jface.text.source.AnnotationModel.getPosition(AnnotationModel.java:766)
	at org.eclipse.jface.text.source.AnnotationModel$RegionIterator.findNext(AnnotationModel.java:114)
	at org.eclipse.jface.text.source.AnnotationModel$RegionIterator.<init>(AnnotationModel.java:88)
	at org.eclipse.jface.text.source.AnnotationModel.getRegionAnnotationIterator(AnnotationModel.java:710)
	at org.eclipse.jface.text.source.AnnotationModel.getAnnotationIterator(AnnotationModel.java:678)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.computeCollapsedNestedAnnotations(ProjectionViewer.java:1018)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.expand(ProjectionViewer.java:824)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.processChanges(ProjectionViewer.java:1163)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWithProjectionAnnotationModel(ProjectionViewer.java:965)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.lambda$0(ProjectionViewer.java:891)
	at org.eclipse.jface.text.source.projection.ProjectionViewer$$Lambda$1580/0x0000000802010a58.run(Unknown Source)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)



Thread 'main' tid=1 (RUNNABLE)
!STACK 0
Stack Trace
	at org.eclipse.jface.text.projection.ProjectionMapping.findFragments(ProjectionMapping.java:301)
	at org.eclipse.jface.text.projection.ProjectionMapping.toImageRegion(ProjectionMapping.java:237)
	at org.eclipse.jface.text.projection.ProjectionMapping.toImageRegion(ProjectionMapping.java:436)
	at org.eclipse.jface.text.TextViewer.modelRange2WidgetRange(TextViewer.java:5169)
	at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.modelRange2WidgetRange(StructuredTextViewer.java:839)
	at org.eclipse.jface.text.TextViewer.modelStyleRange2WidgetStyleRange(TextViewer.java:5338)
	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4685)
	at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4770)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.applyTextRegionCollection(StructuredPresentationReconciler.java:903)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.processDamage(StructuredPresentationReconciler.java:878)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.processRecordedDamages(StructuredPresentationReconciler.java:850)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler$InternalListener.textChanged(StructuredPresentationReconciler.java:416)
	at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2709)
	at org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:397)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:748)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:717)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:701)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:775)
	at org.eclipse.jface.text.projection.ProjectionDocument.fireDocumentChanged(ProjectionDocument.java:772)
	at org.eclipse.jface.text.projection.ProjectionDocument.masterDocumentChanged(ProjectionDocument.java:742)
	at org.eclipse.jface.text.projection.ProjectionDocumentManager.fireDocumentEvent(ProjectionDocumentManager.java:126)
	at org.eclipse.jface.text.projection.ProjectionDocumentManager.documentChanged(ProjectionDocumentManager.java:132)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireDocumentChanged(BasicStructuredDocument.java:462)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1204)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1981)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2425)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.set(BasicStructuredDocument.java:2937)
	at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.handleFileContentChanged(ResourceTextFileBuffer.java:456)
	at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$FileSynchronizer$2.execute(ResourceFileBuffer.java:151)
	at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$SafeFileChange.run(ResourceFileBuffer.java:86)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)


Thread 'main' tid=1 (RUNNABLE)
!STACK 0
Stack Trace
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.removePosition(BasicStructuredDocument.java:2268)
	at org.eclipse.jface.text.DefaultPositionUpdater.notDeleted(DefaultPositionUpdater.java:194)
	at org.eclipse.jface.text.DefaultPositionUpdater.update(DefaultPositionUpdater.java:222)
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.updatePositions(GenericPositionManager.java:406)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.updateDocumentData(BasicStructuredDocument.java:2701)
	at org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.reparse(StructuredDocumentReParser.java:1401)
	at org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.reparse(StructuredDocumentReParser.java:1335)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.updateModel(BasicStructuredDocument.java:2715)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1925)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2425)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.set(BasicStructuredDocument.java:2937)
	at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.handleFileContentChanged(ResourceTextFileBuffer.java:456)
	at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$FileSynchronizer$2.execute(ResourceFileBuffer.java:151)
	at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$SafeFileChange.run(ResourceFileBuffer.java:86)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5096)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4602)
Comment 2 Kevin Bourgault CLA 2021-12-13 12:05:55 EST
Upped Eclipses memory to 4096m, but it doesn't appear to have improved anything.
eg taskbar shows current usage is "754M of 1440M".
Restarted the app I'm debugging.
Every step in the debugger takes many seconds (minimum).
If I restart eclipse, stepping in the debugger takes no measurable time... for a while.

>You seem to suffer from some webtools editor trying to show/maintain some annotations, probably lot of them.

Any idea what, or how to stop it? I tried disabling folding, which resulted in no change.
My source files aren't overly large, and only use standard @Override, and javadoc annotations.
Comment 3 Kevin Bourgault CLA 2022-03-23 13:14:38 EDT
(In reply to Andrey Loskutov from comment #1)
> You seem to suffer from some webtools editor trying to show/maintain some
> annotations, probably lot of them.
> 
> In general, I would suggest to increase your Eclipse heap to at least 4 GB,
> I would not recommend to use 2 GB in productive environment to anyone.
> 
> Typical stacks:
> 
> Thread 'main' tid=1 (RUNNABLE)
> !STACK 0
> Stack Trace
> 	at java.base@15.0.2/java.util.HashMap.hash(HashMap.java:340)
> 	at java.base@15.0.2/java.util.HashMap.getNode(HashMap.java:570)
> 	at java.base@15.0.2/java.util.HashMap.get(HashMap.java:558)
> 	at org.eclipse.jface.text.source.AnnotationMap.get(AnnotationMap.java:100)
> 	at org.eclipse.jface.text.source.AnnotationMap.get(AnnotationMap.java:1)
> 	at
> org.eclipse.jface.text.source.AnnotationModel.getPosition(AnnotationModel.
> java:766)
> 	at
> org.eclipse.jface.text.source.AnnotationModel$RegionIterator.
> findNext(AnnotationModel.java:114)
> 	at
> org.eclipse.jface.text.source.AnnotationModel$RegionIterator.
> <init>(AnnotationModel.java:88)
> 	at
> org.eclipse.jface.text.source.AnnotationModel.
> getRegionAnnotationIterator(AnnotationModel.java:710)
> 	at
> org.eclipse.jface.text.source.AnnotationModel.
> getAnnotationIterator(AnnotationModel.java:678)
> 	at
> org.eclipse.jface.text.source.projection.ProjectionViewer.
> computeCollapsedNestedAnnotations(ProjectionViewer.java:1018)
> 	at
> org.eclipse.jface.text.source.projection.ProjectionViewer.
> expand(ProjectionViewer.java:824)
> 	at
> org.eclipse.jface.text.source.projection.ProjectionViewer.
> processChanges(ProjectionViewer.java:1163)
> 	at
> org.eclipse.jface.text.source.projection.ProjectionViewer.
> catchupWithProjectionAnnotationModel(ProjectionViewer.java:965)
> 	at
> org.eclipse.jface.text.source.projection.ProjectionViewer.
> lambda$0(ProjectionViewer.java:891)
> 	at
> org.eclipse.jface.text.source.projection.ProjectionViewer$$Lambda$1580/
> 0x0000000802010a58.run(Unknown Source)
> 	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
> 	at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
> 
> 
> 
> Thread 'main' tid=1 (RUNNABLE)
> !STACK 0
> Stack Trace
> 	at
> org.eclipse.jface.text.projection.ProjectionMapping.
> findFragments(ProjectionMapping.java:301)
> 	at
> org.eclipse.jface.text.projection.ProjectionMapping.
> toImageRegion(ProjectionMapping.java:237)
> 	at
> org.eclipse.jface.text.projection.ProjectionMapping.
> toImageRegion(ProjectionMapping.java:436)
> 	at
> org.eclipse.jface.text.TextViewer.modelRange2WidgetRange(TextViewer.java:
> 5169)
> 	at
> org.eclipse.wst.sse.ui.internal.StructuredTextViewer.
> modelRange2WidgetRange(StructuredTextViewer.java:839)
> 	at
> org.eclipse.jface.text.TextViewer.
> modelStyleRange2WidgetStyleRange(TextViewer.java:5338)
> 	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4685)
> 	at
> org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:
> 4770)
> 	at
> org.eclipse.wst.sse.ui.internal.provisional.style.
> StructuredPresentationReconciler.
> applyTextRegionCollection(StructuredPresentationReconciler.java:903)
> 	at
> org.eclipse.wst.sse.ui.internal.provisional.style.
> StructuredPresentationReconciler.
> processDamage(StructuredPresentationReconciler.java:878)
> 	at
> org.eclipse.wst.sse.ui.internal.provisional.style.
> StructuredPresentationReconciler.
> processRecordedDamages(StructuredPresentationReconciler.java:850)
> 	at
> org.eclipse.wst.sse.ui.internal.provisional.style.
> StructuredPresentationReconciler$InternalListener.
> textChanged(StructuredPresentationReconciler.java:416)
> 	at
> org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2709)
> 	at
> org.eclipse.jface.text.TextViewer$VisibleDocumentListener.
> documentChanged(TextViewer.java:397)
> 	at
> org.eclipse.jface.text.AbstractDocument.
> doFireDocumentChanged2(AbstractDocument.java:748)
> 	at
> org.eclipse.jface.text.AbstractDocument.
> doFireDocumentChanged(AbstractDocument.java:717)
> 	at
> org.eclipse.jface.text.AbstractDocument.
> doFireDocumentChanged(AbstractDocument.java:701)
> 	at
> org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.
> java:775)
> 	at
> org.eclipse.jface.text.projection.ProjectionDocument.
> fireDocumentChanged(ProjectionDocument.java:772)
> 	at
> org.eclipse.jface.text.projection.ProjectionDocument.
> masterDocumentChanged(ProjectionDocument.java:742)
> 	at
> org.eclipse.jface.text.projection.ProjectionDocumentManager.
> fireDocumentEvent(ProjectionDocumentManager.java:126)
> 	at
> org.eclipse.jface.text.projection.ProjectionDocumentManager.
> documentChanged(ProjectionDocumentManager.java:132)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> _fireDocumentChanged(BasicStructuredDocument.java:462)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> fireStructuredDocumentEvent(BasicStructuredDocument.java:1204)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> internalReplaceText(BasicStructuredDocument.java:1981)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> replaceText(BasicStructuredDocument.java:2425)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> set(BasicStructuredDocument.java:2937)
> 	at
> org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.
> handleFileContentChanged(ResourceTextFileBuffer.java:456)
> 	at
> org.eclipse.core.internal.filebuffers.ResourceFileBuffer$FileSynchronizer$2.
> execute(ResourceFileBuffer.java:151)
> 	at
> org.eclipse.core.internal.filebuffers.ResourceFileBuffer$SafeFileChange.
> run(ResourceFileBuffer.java:86)
> 	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
> 	at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
> 
> 
> Thread 'main' tid=1 (RUNNABLE)
> !STACK 0
> Stack Trace
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> removePosition(BasicStructuredDocument.java:2268)
> 	at
> org.eclipse.jface.text.DefaultPositionUpdater.
> notDeleted(DefaultPositionUpdater.java:194)
> 	at
> org.eclipse.jface.text.DefaultPositionUpdater.update(DefaultPositionUpdater.
> java:222)
> 	at
> org.eclipse.wst.sse.core.internal.text.GenericPositionManager.
> updatePositions(GenericPositionManager.java:406)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> updateDocumentData(BasicStructuredDocument.java:2701)
> 	at
> org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.
> reparse(StructuredDocumentReParser.java:1401)
> 	at
> org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.
> reparse(StructuredDocumentReParser.java:1335)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> updateModel(BasicStructuredDocument.java:2715)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> internalReplaceText(BasicStructuredDocument.java:1925)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> replaceText(BasicStructuredDocument.java:2425)
> 	at
> org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.
> set(BasicStructuredDocument.java:2937)
> 	at
> org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.
> handleFileContentChanged(ResourceTextFileBuffer.java:456)
> 	at
> org.eclipse.core.internal.filebuffers.ResourceFileBuffer$FileSynchronizer$2.
> execute(ResourceFileBuffer.java:151)
> 	at
> org.eclipse.core.internal.filebuffers.ResourceFileBuffer$SafeFileChange.
> run(ResourceFileBuffer.java:86)
> 	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
> 	at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
> 	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5096)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4602)

Any idea what, or how to stop it? I tried disabling folding, which resulted in no change.
My source files aren't overly large, and only use standard @Override, and javadoc annotations.  The problem occurs even with a single source file open
Comment 4 Florian Kolbe CLA 2022-06-02 03:04:52 EDT
Created attachment 288552 [details]
stack dump

Note that this might be related to having large XML file open in an editor (I had one open with 80k lines).
Maybe somewhere around this?
https://github.com/sandipchitale/eclipse.platform.text/commit/92de80af981bd304bdb21046e0ba5fb4bcf6080b
Comment 5 Andrey Loskutov CLA 2022-06-03 12:33:49 EDT
(In reply to Florian Kolbe from comment #4)
> Created attachment 288552 [details]
> stack dump
> 
> Note that this might be related to having large XML file open in an editor
> (I had one open with 80k lines).

Yes, it is. There seem to ne O^2 loop over all annotations (haven't debugged that yet):

"main" #1 prio=6 os_prio=0 cpu=1128296.88ms elapsed=72261.62s tid=0x00000198e4e358e0 nid=0x4bc0 runnable  [0x0000007f229fc000]
   java.lang.Thread.State: RUNNABLE
	at java.util.HashMap.hash(java.base@16.0.1/HashMap.java:340)
	at java.util.HashMap.getNode(java.base@16.0.1/HashMap.java:570)
	at java.util.HashMap.get(java.base@16.0.1/HashMap.java:558)
	at org.eclipse.jface.text.source.AnnotationMap.get(AnnotationMap.java:100)
	- locked <0x0000000080300000> (a java.lang.Object)
	at org.eclipse.jface.text.source.AnnotationMap.get(AnnotationMap.java:1)
	at org.eclipse.jface.text.source.AnnotationModel.getPosition(AnnotationModel.java:766)
	at org.eclipse.jface.text.source.AnnotationModel$RegionIterator.findNext(AnnotationModel.java:114)
	at org.eclipse.jface.text.source.AnnotationModel$RegionIterator.<init>(AnnotationModel.java:88)
	at org.eclipse.jface.text.source.AnnotationModel.getRegionAnnotationIterator(AnnotationModel.java:710)
	at org.eclipse.jface.text.source.AnnotationModel.getAnnotationIterator(AnnotationModel.java:678)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.computeCollapsedNestedAnnotations(ProjectionViewer.java:1018)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.expand(ProjectionViewer.java:824)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.processChanges(ProjectionViewer.java:1163)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWithProjectionAnnotationModel(ProjectionViewer.java:965)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.lambda$0(ProjectionViewer.java:891)
	at org.eclipse.jface.text.source.projection.ProjectionViewer$$Lambda$981/0x0000000100acb070.run(Unknown Source)

> Maybe somewhere around this?
> https://github.com/sandipchitale/eclipse.platform.text/commit/
> 92de80af981bd304bdb21046e0ba5fb4bcf6080b

No, not related to this code.