1
0
Fork 0

fix different resident set size report units

This commit is contained in:
Jan Steemann 2013-05-08 19:10:49 +02:00
parent 509e774774
commit 6740db7207
4 changed files with 13 additions and 9 deletions

View File

@ -448,10 +448,10 @@ actions.defineHttp({
group: "system",
identifier: "residentSize",
name: "Resident Set Size",
description: "The number of pages the process has in real memory. " +
description: "The total size of the number of pages the process has in real memory. " +
"This is just the pages which count toward text, data, or stack space. " +
"This does not include pages which have not been demand-loaded in, " +
"or which are swapped out.",
"or which are swapped out. The resident set size is reported in bytes.",
type: "current",
units: "bytes"
},

View File

@ -239,7 +239,8 @@ TRI_process_info_t TRI_ProcessInfoSelf () {
result._systemTime = TRI_MicrosecondsTv(&used.ru_stime);
result._userTime = TRI_MicrosecondsTv(&used.ru_utime);
result._residentSize = used.ru_maxrss;
// ru_maxrss is the resident set size in kilobytes. need to multiply with 1024 to get the number of bytes
result._residentSize = used.ru_maxrss * 1024;
}
#ifdef TRI_HAVE_MACH
@ -367,7 +368,8 @@ TRI_process_info_t TRI_ProcessInfo (TRI_pid_t pid) {
result._userTime = st.utime;
result._systemTime = st.stime;
result._numberThreads = st.num_threads;
result._residentSize = st.rss;
// st.rss is measured in number of pages, we need to multiply by page size to get the actual amount
result._residentSize = st.rss * getpagesize();
result._virtualSize = st.vsize;
result._scClkTck = sysconf(_SC_CLK_TCK);
}

View File

@ -74,7 +74,7 @@ typedef struct TRI_process_info_s {
uint64_t _userTime;
uint64_t _systemTime;
int64_t _numberThreads;
int64_t _residentSize;
int64_t _residentSize; // resident set size in number of bytes
uint64_t _virtualSize;
uint64_t _scClkTck;
}

View File

@ -1417,10 +1417,12 @@ static v8::Handle<v8::Value> JS_Output (v8::Arguments const& argv) {
///
/// - numberOfThreads: Number of threads in this process.
///
/// - residentSize: Resident Set Size: number of pages the process has
/// in real memory. This is just the pages which count toward text,
/// data, or stack space. This does not include pages which have
/// not been demand-loaded in, or which are swapped out.
/// - residentSize: Resident Set Size: total size of the number of pages
/// the process has in real memory. This is just the pages which count
/// toward text, data, or stack space. This does not include pages which
/// have not been demand-loaded in, or which are swapped out.
///
/// The resident set size is reported in bytes.
///
/// - virtualSize: Virtual memory size in bytes.
///