In [[computer programming]], '''resource management''' refers to techniques for managing [[System resource|resources]] (components with limited availability). It includes both preventing [[resource leak]]s (the act of refusing to release a resource when a process has finished using it) and dealing with [[resource contention]] (when multiple processes wish to access a limited resource). Resource leaks are an issue in sequential computing, while resource contention is an issue in [[concurrent computing]]. This article discusses preventing resource leaks; see [[resource contention]] for resource management in that sense.
[[Computer program]]s may manage their own resources{{which}},andby thereusing arefeatures variousexposed techniques for resource management, depending on theby [[programming language]];s ({{harvtxt|Elder|Jackson|Liblit|2008}} is a survey article contrasting different approaches. Alternatively), theyor may elect canto bemanage managedthem by a host – an [[operating system]] or [[virtual machine]] – or another program.
Host-based Thismanagement 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 (computer science)|garbage collection]] for memory. On many systems the operating system reclaims resources after the process makes the [[exit (system call)|exit]] [[system call]].
==Controlling Access==
Resource management includes both preventing [[resource leak]]s (the act of refusing to release a resource when a process has finished using it) and dealing with [[resource contention]] (when multiple processes wish to access a limited resource).
===Resource leak===
{{main|resource leak}}
Resource leaks are an issue in sequential computing, while resource contention is an issue in [[concurrent computing]].