Sleak (SWT & RCP): device does not track resource allocation (eclipse 4.3)

my RCP application (Java OpenCV video player) throws the famous:

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

So now I found Sleak and tutorial

I tried the first method, but when I launched the application and clicked on the snap button in the "Slick view" mode, I got: "WARNING: the device does not track the distribution of resources."

When I do this the second way (.options file and -debug in eclipse.ini (inserted before -vmargs) I get some results in the sleak view, but they are all Eclipse Resources ... as said, I trace eclipse there ... but I do not want...

I work on Eclipse 4.3 SR1 (RCP) with build string for 4.3 (I tried it with build 4.4, but it didn't work either)

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

 Display display = PlatformUI.createDisplay(); 

as suggested here .

+3
java debugging eclipse swt sleak
source share
4 answers

I just ran into this problem and solved it.

Go to the debug configuration-> tracing tab. Here, make sure you select org.eclipse.ui on the left and select trace / graphics and debug on the right. Now run it. In your RCP you will receive information about what is happening now.

0
source share

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

0
source share

I recently ran into the same problem and managed to find a solution. Here I discovered who knows that this can help you.

In our RCP run, there is a call to PlatformUI.createDisplay () in our Application class, which connects to a call to Workbench.createDisplay (). The exact point at which the debug settings required by Sleak are correctly read and set.

What happened to our software was that a call to Display.getDefault () was made BEFORE calling the PlatformUI.createDisplay () platform. This caused the creation of a new Display object, which was set by default. This creature did not read or set debugging parameters because it happened in a different way.

By the time our code got into the PlatformUI.createDisplay () call, it had not actually created a new Display. Instead, it returned the previously created, not debugged. Thus, the lead Sleak warns that "the device does not monitor the distribution of resources."

Adding a breakpoint in the Display.register method helped us determine the beginning of an early creation and change it correctly.

You may not have written the createDisplay () call to your code, but I'm pretty sure there is somewhere because every platform needs a Display.

0
source share

Fighting this for most of the day, searching for various outdated cookbooks and HowTo pages ... In one of the eclipse forum posts, someone referred to this page, which worked for me. (Oxygen, pure standalone ECP R4 application)

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

Even if it seems odd, you need your working Eclipse application to work with the various flags set before paying attention to your project settings when you run the application in the debugger.

0
source share

All Articles