|Re: high number of handles used by form based editor [message #526973 is a reply to message #526591]
||Tue, 13 April 2010 15:34
| Grant Gayed
Registered: July 2009
The handles you're referring to are likely widget handles, whereas the
handles that Sleak shows are graphics handles.
I count ~130 combined texts and labels in your screenshot, and if page 2 is
similar then we'll estimate around 260 total, each of which invariably do
require their own handle. The forms titles ("Merchant Basic Details" ,
etc.) and TabFolder would also each require a few handles, so roughly half
are accounted for so far. A couple of things are not obvious from the
- If there are many Composites being used for widget layout then this could
account for much of the rest. If you want to get an illustration of how
many are being used, load swt into your workspace and change the
implementation of Composite's constructor to "super (parent, style |
SWT.BORDER);", to create a hall of mirrors. If you find that a lot of
Composites are being used then you should be able to eliminate many of them
by changing your layout strategy to just have one Composite per section with
many columns, and have controls span multiple columns when needed (maybe
you're already doing this?).
- On win32 some controls like Spinner require more than one native handle
per instance. If page 2 is using some of these other types of controls then
perhaps it's eating the extra handles?
To summarize, it's quite possible that ~600 native handles are what's needed
to show your two pages. In the Windows 98 era this would have been a
problem, but these days this is not something to worry about, especially
since you see that they aren't been leaked.
"Philippe Marschall" <firstname.lastname@example.org> wrote in message
> We are seeing a relatively high (~600) number of handles used in our
> form based editors on win32 Vista. These are not leeks, the handles are
> freed if we close the editor. We tried to use Sleak (great tool btw) to
> find you where the handles were going and it tells us 25 colors and 11
> An screen shot of our editor can be found at , the second page looks
> about the same as the first page. We are at roughly 3 handles per
> Label/Text combination. The Texts are mostly setEditable(false). And
> yes, the customer really need each and every of those fields.
> Is this kind of handle usage normal? If no do you have any advice how we
> could track down where they are all going?
>  http://imgur.com/B0OnM
Powered by FUDForum
. Page generated in 0.02237 seconds