Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Windows XP has the limit 10000 user handles for each process and total 32000 for each desktop session. However, when I run 4 or 5 SWT process, each consuming no more than 2000 user handles, the SWT No More handles exception will always be threw.

Does anyone know why?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
599 views
Welcome To Ask or Share your Answers For Others

1 Answer

If I understand you correctly, you are probably getting the following exception:

org.eclipse.swt.SWTError: No more handles

You may be creating resources (such as Font, Image or GC objects) that you aren't correctly disposing. You might want to take a moment to read through the SWT guide on Managing Operating System Resources.

To determine if this is indeed the case, I can recommend this useful article: Diagnosing Handle Leaks in SWT/RCP Windows Applications, which explains what resources are and suggests using Process Explorer or DPus to locate leaks.

A colleague also highly recommends Sleak, a SWT-focused application that can actually inform you which resources are remaining in residual memory.

For a very technical understanding of what handles SWT is making, this Sybase article describes that there are three kinds: User Object, GDI Object or Kernel Object handles, each of which has its own maximum.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...