*** Welcome to piglix ***

Resource management (computing)


In computer programming, resource management refers to techniques for managing resources (components with limited availability).

Computer programs may manage their own resources by using features exposed by programming languages (Elder, Jackson & Liblit (2008) is a survey article contrasting different approaches), or may elect to manage them by a host – an operating system or virtual machine – or another program.

Host-based management is known as resource tracking, and consists of cleaning up resource leaks: terminating access to resources that have been acquired but not released after use. This is known as reclaiming resources, and is analogous to garbage collection for memory. On many systems the operating system reclaims resources after the process makes the exit system call.

The act of refusing to release a resource when a process has finished using it is known as a resource leak, and is an issue in sequential computing. Multiple processes wish to access a limited resource can be an issue in concurrent computing, and is known as resource contention.

Resource management seeks to control access in order to prevent both of these situations.

Formally, resource management (preventing resource leaks) consists of ensuring that a resource is released if and only if it is successfully acquired. This general problem can be abstracted as "before, body, and after" code, which normally are executed in this order, with the condition that the after code is called if and only if the before code successfully completes, regardless of whether the body code executes successfully or not. This is also known as a code sandwich, and occurs in various other contexts, such as a temporary change of program state, or tracing entry and exit into a subroutine. However, resource management is the most commonly cited application.


...
Wikipedia

...