Bug 567355 - Debug view hangs UI for extended periods
Summary: Debug view hangs UI for extended periods
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2020-09-25 09:14 EDT by Clemens Wyss CLA
Modified: 2023-06-01 12:39 EDT (History)
3 users (show)

See Also:


Attachments
Threaddump 1 (56.00 KB, text/plain)
2020-09-25 09:14 EDT, Clemens Wyss CLA
no flags Details
Threaddump 2 (57.08 KB, text/plain)
2020-09-25 09:14 EDT, Clemens Wyss CLA
no flags Details
Threaddump 3 (59.90 KB, text/plain)
2020-09-25 09:15 EDT, Clemens Wyss CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Clemens Wyss CLA 2020-09-25 09:14:39 EDT
Created attachment 284267 [details]
Threaddump 1

there was
https://bugs.eclipse.org/bugs/show_bug.cgi?id=552328
and
https://bugs.eclipse.org/bugs/show_bug.cgi?id=552563
in which I was involved too ;)

As of 

Eclipse Platform
Version: 2020-12 (4.18)
Build id: I20200922-1800

I am facing this "issue" again

Find attached 3 threaddumps (taken with VisualVM) when Eclipse "hangs"

Former environment variable
-Dorg.eclipse.jdt.internal.debug.core.model.ThreadNameChangeListener.disable=true
does not seem to help
Comment 1 Clemens Wyss CLA 2020-09-25 09:14:58 EDT
Created attachment 284268 [details]
Threaddump 2
Comment 2 Clemens Wyss CLA 2020-09-25 09:15:15 EDT
Created attachment 284269 [details]
Threaddump 3
Comment 3 Clemens Wyss CLA 2020-09-25 09:18:16 EDT
(no big suprise) closing the Debug View helps
Comment 4 Andrey Loskutov CLA 2020-09-25 09:35:12 EDT
The dumps are showing same picture, the UI hangs in Tree.getSelection

How many threads do you have? Some thousands?

"main" #1 prio=6 os_prio=0 cpu=1476718.75ms elapsed=101538.24s tid=0x000000000371b000 nid=0x37cc runnable  [0x000000000095c000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.win32.OS.SendMessage(Native Method)
	at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3426)
	at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3446)
	at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3446)
	at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3496)
	at org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:231)
	at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:308)
	at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2571)
	at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:3027)
	at org.eclipse.jface.viewers.TreeViewer.replace(TreeViewer.java:490)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.handleAdd(TreeModelContentProvider.java:1345)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1263)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1299)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1299)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1299)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateModel(TreeModelContentProvider.java:563)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.doModelChanged(TreeModelContentProvider.java:530)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.access$0(TreeModelContentProvider.java:524)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider$DelayedDoModelChangedJob.runInUIThread(TreeModelContentProvider.java:436)
	at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95)
Comment 5 Clemens Wyss CLA 2020-09-25 10:01:16 EDT
>How many threads do you have?
Approx 200-300
Comment 6 Clemens Wyss CLA 2020-09-25 11:04:01 EDT
Pls also note that I am on
Version: 2020-12 (4.18)
Build id: I20200922-1800

i.e. 4.18 (Integration Builds)
Comment 7 Andrey Loskutov CLA 2020-09-25 11:06:46 EDT
(In reply to Clemens Wyss from comment #6)
> Pls also note that I am on
> Version: 2020-12 (4.18)
> Build id: I20200922-1800
> 
> i.e. 4.18 (Integration Builds)

Means: you see regression compared with 4.17?

(In reply to Clemens Wyss from comment #5)
> Approx 200-300

Are they all short living, so that they are starting and disappearing very, for a longer period of time?

Any chance to have an reproducer?
Comment 8 Clemens Wyss CLA 2020-09-26 01:37:06 EDT
>Means: you see regression compared with 4.17?
not sure. Just went back to 

Version: 2020-09 (4.17)
Build id: I20200902-1800

and facing the same issue. With 4.17 I have been on integration builds, too. Pretty sure that a month ago this problem was not present.

>Are they all short living, so that they are starting and disappearing very, 
>for a longer period of time?
the mentioned 200-300 are more or less "static" (but many of em mostly idle). Other threads may come and go. AND in some threads we change the threads name while running

>Any chance to have an reproducer?
Unfortunately not, sorry. I know, this doesn't help solving/analyzing the "problem"

The (Thomcat run) App I am working on is absolutely responsive when Eclipse "freezes"
Comment 9 Andrey Loskutov CLA 2020-09-26 03:15:46 EDT
(In reply to Clemens Wyss from comment #8)
> >Means: you see regression compared with 4.17?
> not sure. Just went back to 
> 
> Version: 2020-09 (4.17)
> Build id: I20200902-1800
> 
> and facing the same issue. 

Thanks. 

> With 4.17 I have been on integration builds, too.
> Pretty sure that a month ago this problem was not present.

That couldn't be a change in your code may be?

Would be great if you could bisect in which build you see the problem appearing, even if you could just identify that it was something like "afeter 4.17 M3".
Comment 10 Clemens Wyss CLA 2020-09-26 03:32:22 EDT
Due to this issue/bug in Eclipse I have found an issue in our code. From time to time we did effectively spawn "insanely many" (due to VisualVM approx 400!) threads just to do something "asynchronously". 

Could "fix" this by making use of an (single threaded and debouncing) executorService.

>That couldn't be a change in your code may be?
The code I "fixed" is very old. It may be due to the "data" that there were/are more invokations and hence thread-spawns...


Now to me "this issue" is "solved".

BUT the question remains why Eclipse JDT has a problem with "insanely/stupidly many threads being spawned 'concurrently'" whereas e.g. VisualVM doesn't. Maybe improve the refresh-debouncing algorithm?
Comment 11 Clemens Wyss CLA 2020-09-26 04:09:56 EDT
@Andrey : thx a lot (vielen Dank) for looking into this

Let me know if I can help any further. For example testing an improved "refresh-debouncing algorithm". Which I can/could easily by reverting my "change"/"improvement" ;)
Comment 12 Andrey Loskutov CLA 2020-09-26 04:25:57 EDT
One point: could you please open Debug view and post here, which options are checked and which not under view menu -> Java -> ...
Comment 13 Clemens Wyss CLA 2020-09-26 05:51:23 EDT
[x]Show Monitors
[x]Show Running Threads
[ ] Show System Threads
[ ] Show Qualified Names
[ ] Show Thread Groups
Comment 14 Markus S CLA 2021-06-04 01:27:20 EDT
I'm facing the same issue with 4.16.
My application has ~350 more or less idle threads.

Eclipse hangs horrible for a couple of seconds once I enter a new method/stack before I can step over without further freezes. Once I enter a new method/stack the freeze fun starts over again.




org.eclipse.swt.internal.win32.OS.SendMessage(Native Method)
org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3387)
org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3407)
org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3407)
org.eclipse.swt.widgets.Tree.getSelection(Tree.java:3457)
org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:231)
org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:308)
org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2564)
org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:3020)
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1407)
org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:363)
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1361)
org.eclipse.jface.viewers.TreeViewer.setChildCount(TreeViewer.java:384)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.handleAdd(TreeModelContentProvider.java:1343)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1263)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1299)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1299)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateNodes(TreeModelContentProvider.java:1299)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateModel(TreeModelContentProvider.java:563)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.doModelChanged(TreeModelContentProvider.java:530)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.access$0(TreeModelContentProvider.java:524)
org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider$DelayedDoModelChangedJob.runInUIThread(TreeModelContentProvider.java:436)
org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95)
org.eclipse.ui.progress.UIJob$$Lambda$730/0x00000008015ad440.run(Unknown Source)
org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
   - locked org.eclipse.swt.widgets.RunnableLock@2fe9cb7a
org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4005)
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3633)
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658)
org.eclipse.ui.internal.Workbench$$Lambda$128/0x0000000800e33c40.run(Unknown Source)
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:564)
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
org.eclipse.equinox.launcher.Main.run(Main.java:1447)
Comment 15 Sarika Sinha CLA 2021-06-04 04:02:59 EDT
(In reply to Markus S from comment #14)
> I'm facing the same issue with 4.16.
> My application has ~350 more or less idle threads.
> 
> Eclipse hangs horrible for a couple of seconds once I enter a new
> method/stack before I can step over without further freezes. Once I enter a
> new method/stack the freeze fun starts over again.
> 
>

Can you try to start Eclipse with the system property -Dorg.eclipse.jdt.internal.debug.core.model.ThreadNameChangeListener.disable
Comment 16 Markus S CLA 2021-06-04 12:24:46 EDT
Thanks, but tetting that property did not have any effect.
Comment 17 Markus S CLA 2021-06-04 15:03:42 EDT
I was trying to check the behavior with 4.19 but I'm unable to start my application with 4.19 anymore (see bug 574031)
Comment 18 Andrey Loskutov CLA 2021-06-04 15:26:53 EDT
Markus, do you jave a chance to debug your application on Linux platform? Just wondering if we see some weird Windows/SWT tree selection issue on big trees.

How many threads do you see im the Debug view before the freeze? 
Are there many short living threads (starting/terminating all the time)?
Comment 19 Markus S CLA 2021-06-04 15:46:01 EDT
Unfortunately my application consists of 750 bundles worth several GB so it's not that easy to setup a Linux VM and try to reproduce the problem in the VM. Also not sure if running it in a VM would help at all.

After startup, my application has a constant level of roughly 350 threads, there are lots of thread pools containing demons and workers. There are no short living threads since we pre-start all necessary threads and keep them idle/park.

Every time I enter a specific stack frame, it takes a couple of seconds before it "stabilizes".

Also what I noticed that if set a breakpoint in parts of the code that multiple threads are hitting at the same time the problem gets much worse and Eclipse freezes multiple times, resumes for a bit, freezes again, while you can see the debug view slowly expanding the stack frames on each thread.
Comment 20 Eclipse Genie CLA 2023-06-01 12:39:51 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.