Sleak (SWT & RCP) : Device is not tracking resource allocation (eclipse 4.3)
Asked Answered
A

4

3

my RCP application (Video-Player with OpenCV java) throws the famous:

org.eclipse.swt.SWTError: No more handles Error

So now I found Sleak and a tutorial

I tryed the first way, but when I start the app and click on the snap button in the Sleak-View I got: "WARNING: Device is not tracking resource allocation".

When I do it the second way(.options file and -debug in the eclipse.ini (inserted befor the -vmargs) I get some results in the sleak view but they are all Eclipse Resources... like said there I've trace eclipse ... but I do not want to ...

I'am running on Eclipse 4.3 SR1 (RCP) with sleak build for 4.3 (I have tryed it with the 4.4 build but it did not work either)

And in my RCP (e4) application is no Part where I do

Display display = PlatformUI.createDisplay();

like proposed here.

Azoth answered 30/1, 2014 at 15:33 Comment(2)
I have checked with an independet stand-alone SWT Application. And the Tip from the tutorial worked. But as I said, in RCP it is not possible to access the Display Creation.Azoth
Possible duplicate of Sleak in RCP: Device is not tracking resource allocationKaryotin
G
1

I just faced this problem and solved it.

Go to debug configuration-> tracing tab. Here make sure that you have selected org.eclipse.ui on the left side and select tracing/graphics and debug on the right side. Now launch it . In your RCP you will be getting the sleak information now.

Gormandize answered 31/10, 2014 at 5:59 Comment(1)
Yeah no sorry I found this info before but it did not work for me. I could not get Sleak to work with RCP since...Azoth
F
0

Add this to your debug Configuration:

Tracing Tab:
    org.eclipse.ui:
    debug = true
    trace/graphics = true

http://www.vogella.com/tutorials/EclipsePerformance/article.html#performance_sleak

Fin answered 26/5, 2015 at 14:58 Comment(1)
did not work for me like I wrote in the comment to the last answerAzoth
K
0

I recently faced the same problem, and managed to find a solution. Here's what I discovered, who knows it might help you.

On our RCP startup, there's a call to PlatformUI.createDisplay() on our Application class, which chains to a call to Workbench.createDisplay(). That's the exact point where the debug settings needed by Sleak are properly read and set.

What happened on our software was that a call to Display.getDefault() was made BEFORE the above call to PlatformUI.createDisplay(). It caused the creation of a new Display object, which was set as the default one. This creation did not read and set the debug settings, because it happened on a different path.

By the time our code got to the PlatformUI.createDisplay() call, it didn't actually create a new Display. Instead, it returned the previously-created, not-debug-friendly one. Thus leading Sleak into warning about "device not tracking resource allocation".

Adding a breakpoint at the method Display.register (Display display) helped us identifying the early creation origin and properly change it.

You might have not hand written the createDisplay() call on your code, but I'm pretty sure there's one somewhere, because every Platform needs a Display.

Karyotin answered 11/7, 2016 at 11:56 Comment(0)
A
0

Struggled with this for most of day, finding a variety of out-of-date cookbooks and HowTo pages... In one of the eclipse forum posts, someone referenced this page, which worked for me. (Oxygen, pure E4 standalone RCP application)

https://wiki.eclipse.org/Eclipse4/RCP/FAQ#How_to_use_Sleak_in_e4AP

Even tho it seems odd, you have to have your Eclipse workbench application running with various flags set, before it pays any attention to your project settings when running your application in the debugger.

Ascender answered 9/12, 2017 at 1:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.