Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-dev] No more handles in SWT, can this number be configured?

What everybody.

Unfortunately, it looks like deviceData.objects also "only" tracks the
disposable objects, not all objects. For example, if I create 1000
Labels and enable tracking these are not included in the count.

----------
DeviceData deviceData = widget.getDisplay().getDeviceData();
int length = deviceData.objects.length;
System.out.println(length);
------------

Best regards, Lars



On Thu, Apr 15, 2021 at 10:36 PM Jonah Graham <jonah@xxxxxxxxxxxxxxxx> wrote:
>
>
> ~~~
> Jonah Graham
> Kichwa Coders
> www.kichwacoders.com
>
>
> On Thu, 15 Apr 2021 at 15:27, Alex Blewitt <alex.blewitt@xxxxxxxxx> wrote:
>>
>> On 15 Apr 2021, at 19:31, Wim Jongman <wim.jongman@xxxxxxxxx> wrote:
>>
>> On Thu, Apr 15, 2021 at 6:09 PM Lars Vogel <lars.vogel@xxxxxxxxxxx> wrote:
>>>
>>>
>>>
>>> Would be nice to be able to ask SWT at runtime for the currently
>>> allocated handlers so that we can be a bit more reactive to the
>>> currently available handlers instead of just using a hard-tab limit.
>>
>>
>> Display.getDeviceData().objects?
>> https://help.eclipse.org/2021-03/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Findex.html
>>
>>
>> This only returns a value if tracking has been enabled, and it adds a significant overhead. It’s useful for tracking down some leaks but wouldn’t recommend using it for an application in real use. In any case, the set of objects here don’t necessarily tell you how many handles are being used by the OS, although to a first-order approximation you could guess on a 1-1 mapping.
>
>
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/163437 adds DeviceData#getAllocatedResourceCount which returns number of allocated devices without the overhead of objects, nor needing tracking to be on.
>
> HTH,
> Jonah
>
>
>>
>>
>> Alex
>> _______________________________________________
>> eclipse-dev mailing list
>> eclipse-dev@xxxxxxxxxxx
>> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/eclipse-dev
>
> _______________________________________________
> eclipse-dev mailing list
> eclipse-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/eclipse-dev



-- 
Eclipse Platform project co-lead
CEO vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com


Back to the top