Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No more handles" - after editing many MANIFEST.MF #2304

Open
jukzi opened this issue Sep 20, 2024 · 7 comments
Open

"No more handles" - after editing many MANIFEST.MF #2304

jukzi opened this issue Sep 20, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@jukzi
Copy link
Contributor

jukzi commented Sep 20, 2024

image
image

I have a Heapdump - how do i figure out what leaked?
image

@jukzi jukzi added the bug Something isn't working label Sep 20, 2024
@akurtakov
Copy link
Member

akurtakov commented Sep 20, 2024

No more handles means the OS is out of resources for more widgets. Most likely an SWT widget is recreated over and over without unused ones being disposed. You may want to try Sleak (https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt.tools.spies/src/org/eclipse/swt/tools/views/SleakView.java ) and there is an old article on using it https://www.eclipse.org/articles/swt-design-2/sleak.htm . I haven't used it in years so I'm not sure of current state of the tool.
Long story short - it's most likely a missing dispose() somewhere.

@mickaelistria
Copy link
Contributor

If you can monitor the running application on your machine, using Sleak can help.
Here there are 12k resource trackers, which means that there are 12k resources; tracker element and their "nest" object will show which objects are locking the resources/missing the dispose().

@jukzi
Copy link
Contributor Author

jukzi commented Sep 20, 2024

Why would i have a thousend fonts in my heap?
Beside that i don't get where i can see useful information in the dump:
image

If anybody wants to look:
https://securetransfer.ssi-schaefer.com/webdownload?deliveryUuid=b2398f9c-3c49-4310-a8e5-cf39f47f21bc

BTW the Exception was:

org.eclipse.swt.SWTError: No more handles
	at org.eclipse.swt.SWT.error(SWT.java:4948)
	at org.eclipse.swt.SWT.error(SWT.java:4837)
	at org.eclipse.swt.SWT.error(SWT.java:4808)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:500)
	at org.eclipse.swt.widgets.Control.createHandle(Control.java:675)
	at org.eclipse.swt.widgets.Scrollable.createHandle(Scrollable.java:146)
	at org.eclipse.swt.widgets.Composite.createHandle(Composite.java:300)
	at org.eclipse.swt.widgets.Control.createWidget(Control.java:701)
	at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:161)
	at org.eclipse.swt.widgets.Control.<init>(Control.java:121)
	at org.eclipse.swt.widgets.Scrollable.<init>(Scrollable.java:85)
	at org.eclipse.swt.widgets.Composite.<init>(Composite.java:103)
	at org.eclipse.swt.widgets.Canvas.<init>(Canvas.java:81)
	at org.eclipse.jface.text.source.AnnotationRulerColumn$3.<init>(AnnotationRulerColumn.java:338)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.createCanvas(AnnotationRulerColumn.java:338)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.createControl(AnnotationRulerColumn.java:256)
	at org.eclipse.ui.internal.texteditor.AnnotationColumn.createControl(AnnotationColumn.java:70)
	at org.eclipse.jface.text.source.CompositeRuler.addDecorator(CompositeRuler.java:544)
	at org.eclipse.ui.texteditor.AbstractTextEditor$ColumnSupport$1.run(AbstractTextEditor.java:1632)

@jukzi
Copy link
Contributor Author

jukzi commented Sep 20, 2024

Would be better if the excpetion would just log a histogram of the resource stacktraces.

@HeikoKlare
Copy link
Contributor

I would rather expect the reason to be in controls, not in resources. 12k resource trackers does not seem to be too many. In an ordinary SDK product, I have > 30k resource trackers. Note that not each resource tracker means that there is a handle behind it. E.g., there are many font instances sharing the same handle. Usually, on Windows you have only few font handles but many Font instances (e.g., due to this implementation). TextLayouts (which are by far most of the resources in the heap dump) don't even have a handle on their own (do they?) but may only reference other elements that then use handles.

The task manager screenshot indicates that you are running out of user object handles. There are 9982 with 10000 being the limit on Windows. Maybe the reason is related to the number of controls? E.g. there seem to be quite some TreeItem instances:
image

@jukzi
Copy link
Contributor Author

jukzi commented Sep 20, 2024

@HeikoKlare
Copy link
Contributor

Okay, I see that there are several fonts without that flag. They seem to be created in StyledTextRenderer for the purpose of styled text rendering.
image

Still, they only make up few of the font instances. But it could make sense if some StyledText / StyledTextRenderer and with them the fonts are leaked (or at least, not cleaned up already). Did you have many (other) text editors open when or before creating the heap dump? Or was it "only" the Manifest editors? There are 357 StyledText instances and an according number of renderers.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants