In our RCP 4 application we have had SWT exceptions thrown caused by there being no more handles available. This could be caused by a resource leak or by other 3rd party applications running. We are unable to reproduce this in development so we would like to log any information that could possibly help us fix this in the future.
We would like to get information about the handles. E.g. Total handles and what they are used for such as images, fonts, and composites.
I've been looking this up and I'm struggling to find anything on how this can be done in Java. We could execute command line for the information but that doesn't feel like a great way of doing it.
By Handles
I'm referring to GDI Handles
and User Handles
on Windows.
How might this be done?
plugin.xml
<plugin>
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.e4.ui.workbench.swt.E4Application"
name="appid">
<property
name="modelResourceHandler"
value="bundleclass://a.model.resource.handler.ModelResourceHandler">
</property>
</product>
</extension>
</plugin>