From WikiChip
Difference between revisions of "resident set size"

(Created page with "The '''resident set size''' ('''RSS''') is the amount of space of physical memory (RAM) held by a process. The value is typically specified in bytes or pages. ...")
 
Line 5: Line 5:
 
== Overview ==
 
== Overview ==
 
In well-configured operating system, the RSS, which is typically specified in [[pages]], should equal the process' [[working set size|working set]]. Because the exact [[working set size]] often cannot be calculated, a processes usually have more pages than needed for its working set. While most systems today do not employee a working-set model due to its lack of accurate information about the reference pattern of a process, they do keep track of the resident set size. The use of RSS is often used in making decisions on whether the system had enough space to swap the process when it entered the [[ready queue]].
 
In well-configured operating system, the RSS, which is typically specified in [[pages]], should equal the process' [[working set size|working set]]. Because the exact [[working set size]] often cannot be calculated, a processes usually have more pages than needed for its working set. While most systems today do not employee a working-set model due to its lack of accurate information about the reference pattern of a process, they do keep track of the resident set size. The use of RSS is often used in making decisions on whether the system had enough space to swap the process when it entered the [[ready queue]].
 +
 +
== Current RSS ==
 +
 +
=== /proc/self/status ===
 +
The RSS of the current process can be queried by reading the contents of ''/proc/self/status''. The path ''/proc/<nowiki />[PID]/status'' can be used to look up the RSS of a given process by its [[Process identifier|process ID]]. For example, one could get the current RSS of [[Firefox]] by invoking the following [[Shell]] code:
 +
 +
<source lang=bash>cat /proc/`pidof firefox`/status | grep VmRSS</source>
  
 
== See also ==
 
== See also ==
 
* [[working set size]]
 
* [[working set size]]
 
* [[Virtual size]]
 
* [[Virtual size]]

Revision as of 06:57, 7 February 2014

The resident set size (RSS) is the amount of space of physical memory (RAM) held by a process. The value is typically specified in bytes or pages. If the full amount of space required by a process exceeds the RSS, the remaining portion is typically stored in swap.

The peak resident set size (Peak RSS) refers to the peak amount of memory a process has had up to now.

Overview

In well-configured operating system, the RSS, which is typically specified in pages, should equal the process' working set. Because the exact working set size often cannot be calculated, a processes usually have more pages than needed for its working set. While most systems today do not employee a working-set model due to its lack of accurate information about the reference pattern of a process, they do keep track of the resident set size. The use of RSS is often used in making decisions on whether the system had enough space to swap the process when it entered the ready queue.

Current RSS

/proc/self/status

The RSS of the current process can be queried by reading the contents of /proc/self/status. The path /proc/[PID]/status can be used to look up the RSS of a given process by its process ID. For example, one could get the current RSS of Firefox by invoking the following Shell code:

cat /proc/`pidof firefox`/status | grep VmRSS

See also