Bug 550555 - org.eclipse.swt.SWTError: No more handles error when 10K Hyperlinks are created
Summary: org.eclipse.swt.SWTError: No more handles error when 10K Hyperlinks are created
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.10   Edit
Hardware: PC Windows 10
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-29 04:52 EDT by Manoj BB CLA
Modified: 2019-09-27 05:39 EDT (History)
3 users (show)

See Also:


Attachments
Create a table and hyperlinks to it. (4.55 KB, text/plain)
2019-08-29 04:52 EDT, Manoj BB CLA
no flags Details
Create table with fake controls. (4.08 KB, text/plain)
2019-09-09 15:42 EDT, Paul Pazderski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj BB CLA 2019-08-29 04:52:51 EDT
Created attachment 279705 [details]
Create a table and hyperlinks to it.

When attempting to create huge number of hyperlinks(5000+), eclipse throws 'No more handles' error. When the number is less than 5000, the application runs but will be too slow to respond.

I have attached the java class to reproduce the issue(attachment TableEditorTest.txt). Similar to this example, i am creating hyperlinks in my application and i am facing this problem. 

Some ways i tried to fix this issue,
- tried increasing the heap size and that didn`t help. 
- I have also tried changing the registry value as in the commnet(https://bugs.eclipse.org/bugs/show_bug.cgi?id=292464#c13), but that didn`t solve my problem as well.
Comment 1 Nikita Nemkin CLA 2019-08-29 05:34:11 EDT
SWT uses native win32 widgets by design. The 10k handle limit is unavoidable.

Your best option is to custom draw the links. It's likely to be much faster and use less memory too.
Comment 2 Manoj BB CLA 2019-08-30 02:46:31 EDT
(In reply to Nikita Nemkin from comment #1)
> SWT uses native win32 widgets by design. The 10k handle limit is unavoidable.
> 
> Your best option is to custom draw the links. It's likely to be much faster
> and use less memory too.

I didn`t get what 5000 hyperlinks creation has got to do with 10K limit. Also, what do you mean by 'custom draw the links'? 
Isn`t there a workaround to overcome 10K limit? 
I need to fix this as soon as possible as my customer is waiting for the fix.
Comment 3 Niraj Modi CLA 2019-09-09 14:02:04 EDT
(In reply to Nikita Nemkin from comment #1)
> SWT uses native win32 widgets by design. The 10k handle limit is unavoidable.
> 
> Your best option is to custom draw the links. It's likely to be much faster
> and use less memory too.

Hi Nikita,
Please share more information/ideas on how anyone can get away with 10K limit.
Appreciate any SWT snippet achieving that. Thanks!
Comment 4 Niraj Modi CLA 2019-09-09 14:13:27 EDT
(In reply to Manoj BB from comment #2)
> (In reply to Nikita Nemkin from comment #1)
> > SWT uses native win32 widgets by design. The 10k handle limit is unavoidable.
> > 
> > Your best option is to custom draw the links. It's likely to be much faster
> > and use less memory too.
> 
> I didn`t get what 5000 hyperlinks creation has got to do with 10K limit.
Seeing your test snippet, it looks like you are creating two table columns, each containing Hyperlink. IMO that's why you hit the limit at 5000 hyperlinks.

> Also, what do you mean by 'custom draw the links'? 
> Isn`t there a workaround to overcome 10K limit? 
> I need to fix this as soon as possible as my customer is waiting for the fix.

Here is the reasoning from Microsoft for the 10K limit:
https://devblogs.microsoft.com/oldnewthing/20070718-00/?p=25963
Comment 5 Paul Pazderski CLA 2019-09-09 15:42:43 EDT
Created attachment 279819 [details]
Create table with fake controls.

I made an almost good alternative which can handle 10,000 rows. It is almost good because it requires FULL_SELECTION to be enabled. For whatever reason it is not possible to get the cell at a point when it is not selectable at this point.
Comment 6 Niraj Modi CLA 2019-09-27 05:39:15 EDT
(In reply to Paul Pazderski from comment #5)
> Created attachment 279819 [details]
> Create table with fake controls.
> 
> I made an almost good alternative which can handle 10,000 rows. It is almost
> good because it requires FULL_SELECTION to be enabled. For whatever reason
> it is not possible to get the cell at a point when it is not selectable at
> this point.

Thanks Paul for sharing this SWT snippet.
Clsoing, as we don't expect any changes in SWT side for this bug.