Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Dispose question
Dispose question [message #826056] Wed, 21 March 2012 11:47 Go to next message
Eclipse UserFriend
Hi,

When the JVM terminates, are all operating system handles (font, images) automatically released, even when there is no explicit dispose? Or are the non-disposed operating system handles in use until the next OS restart?

Regards,

Wim

[Updated on: Wed, 21 March 2012 11:47] by Moderator

Re: Dispose question [message #826223 is a reply to message #826056] Wed, 21 March 2012 16:30 Go to previous messageGo to next message
Eclipse UserFriend
Hello Jim

The good sense would tell yes (otherwise the OS has a resource management problem). A stack overflow question http://stackoverflow.com/questions/9427890/are-native-screen-resources-automatically-released-when-the-jvm-exits tells also yes.
Another question http://stackoverflow.com/questions/3809808/jvm-abnormal-exit-cleanup-of-system-resources is more targeted to the resources to be released.

Can I ask what was the problem/issue that triggered your question?

On Windows we have used GDI View http://www.nirsoft.net/utils/gdi_handles.html to observe the GDI resources allocated to a Java application. For other OS's I do not know similar tools and I would appreciate if somebody will point me to such tools.

[Later Edit] http://www.eclipse.org/articles/swt-design-2/swt-design-2.html --> Quote:
The operating system frees all of a program's resources when the program exits.

[Updated on: Wed, 21 March 2012 16:45] by Moderator

Re: Dispose question [message #826788 is a reply to message #826223] Thu, 22 March 2012 10:03 Go to previous message
Eclipse UserFriend
Hello Catalin,

Thanks! I had the feeling that closing the process would also reclaim all resources but was never able to find the written rule.

Quote:
The operating system frees all of a program's resources when the program exits. Why not just rely on this? Operating system resources are not infinite. If your program doesn't free up resources as they are no longer needed, it can run out of resources. It can also cause other programs to run out of resources. So waiting until the program exits to free up resources is generally a bad idea. Leak tools exist to help detect resource leaks. You can use the Sleak tool to look for leaks in your SWT application.


from: http://www.eclipse.org/articles/swt-design-2/swt-design-2.html
Previous Topic:segmentation fault indigo SR2 with glassfish 3.1.2 plugin
Next Topic:Scrollbar inside a tabItem
Goto Forum:
  


Current Time: Wed Jul 23 01:35:42 EDT 2025

Powered by FUDForum. Page generated in 0.04152 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top