5

from time to time I am haunted by the "org.eclipse.swt.SWTError: No more handles". I already know tools like GDIView, to watch the number of handles allocated, but now I wonder if there is a better way to do this.

Is there a tool available? Maybe one that logs all stacktraces when handles are created? And which shows the new handles between two invocation points?

Regards, Daniel

PS: Added the windows tag because dev occures mostly on windows and a windows only tool would be good enough.

Daniel
  • 27,718
  • 20
  • 89
  • 133
  • This question may be related to your inquiry: http://stackoverflow.com/questions/164776/overcoming-windows-user-object-handle-limit – Zoot Mar 14 '11 at 15:15
  • @Zoot: He seems to work on the symptoms, not the cause. I am just looking for the real leaks, I don't really need many handles. It is that just over time there are too many resources used. By using sleak I was even able to look for recreated resources. Debugging this also makes my app noticable faster over RDP. – Daniel Mar 15 '11 at 08:03

2 Answers2

3

I found out about Sleak, a great tool to debug SWT resources! Highly recommended for everyone with the same problems. Even shows the images for image resources!

Daniel
  • 27,718
  • 20
  • 89
  • 133
0

For me the issue was simply that new Shell() has been called too often. Storing the shell as static member and reusing it helped. Therefore, before applying a tool like Sleak, others might want to do a full text search for "new Shell" and check that they don't have the same simple cause.

Stefan
  • 10,010
  • 7
  • 61
  • 117