Resource management (computing): Difference between revisions

Content deleted Content added
m v1.38 - Repaired 1 link to disambiguation page - (You can help) - Resource (computing)
top: wording, link
Line 5:
[[Computer program]]s may manage their own resources, and there are various techniques for resource management, depending on the [[programming language]]; {{harvtxt|Elder|Jackson|Liblit|2008}} is a survey article contrasting different approaches. Alternatively, they can be managed by a host – an [[operating system]] or [[virtual machine]] – or another program. This 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]].
 
A key distinction in resource management within a program is between ''stack management'' and ''heap management'' – whether a resource can be handled like a stack variable (lifetime is restricted to a single [[stack frame]], being acquired on entry to or within a particular scope, and released when execution enters and exits a particularthat scope), or whether a resource must be handled like a heap variable, such as a resource acquired within a function and then returned from it, which must then be released outside of the acquiring function. Stack management is a common use case, and is significantly easier to handle than heap management.
 
==Statement of problem==