For faster navigation, this Iframe is preloading the Wikiwand page for Handle leak.

Handle leak

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: "Handle leak" – news · newspapers · books · scholar · JSTOR (December 2009) (Learn how and when to remove this message)

A handle leak is a type of software bug that occurs when a computer program asks for a handle to a resource but does not free the handle when it is no longer used.[1] If this occurs frequently or repeatedly over an extended period of time, a large number of handles may be marked in-use and thus unavailable, causing performance problems or a crash.

The term is derived from memory leak. Handle leaks, like memory leaks, are specific instances of resource leaks.

Causes

[edit]

One cause of a handle leak is when a programmer mistakenly believes that retrieving a handle to an entity is simply obtaining an unmanaged reference, without understanding that a count, a copy, or other operation is actually being performed. Another occurs because of poor exception handling design patterns when programmers do not consider that when an exception occurs and a sub routine is exited prematurely, the cleanup code at the end of the routine may not be executed.

An example of this might be retrieving a handle to the display device. Programmers might use this handle to check some property (e.g. querying the supported resolutions), and then simply proceed on without ever releasing the handle. If the handle was just a pointer to some data structure with no additional management, then allowing the handle to pass out of scope would not cause an issue. However, in many cases, such handles must be explicitly closed or released to avoid leaking resources associated with them; the exact requirements for what must be done with a handle varies by interface.

References

[edit]
  1. ^ "What Is a Handle Leak? (with picture)". EasyTechJunkie. Retrieved 2022-11-11.


{{bottomLinkPreText}} {{bottomLinkText}}
Handle leak
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?