Method System.getrusage()
- Method
getrusage
mapping(string:int) getrusage()- Description
Return resource usage about the current process. An error is thrown if it isn't supported or if the system fails to return any information.
- Returns
Returns a mapping describing the current resource usage:
"utime":intTime in milliseconds spent in user code.
"stime":intTime in milliseconds spent in system calls.
"maxrss":intMaximum used resident size in kilobytes. [1]
"ixrss":intQuote from GNU libc: An integral value expressed in kilobytes times ticks of execution, which indicates the amount of memory used by text that was shared with other processes. [1]
"idrss":intQuote from GNU libc: An integral value expressed the same way, which is the amount of unshared memory used for data. [1]
"isrss":intQuote from GNU libc: An integral value expressed the same way, which is the amount of unshared memory used for stack space. [1]
"minflt":intMinor page faults, i.e. TLB misses which required no disk I/O.
"majflt":intMajor page faults, i.e. paging with disk I/O required.
"nswap":intNumber of times the process has been swapped out entirely.
"inblock":intNumber of block input operations.
"oublock":intNumber of block output operations.
"msgsnd":intNumber of IPC messsages sent.
"msgrcv":intNumber of IPC messsages received.
"nsignals":intNumber of signals received.
"nvcsw":intNumber of voluntary context switches (usually to wait for some service).
"nivcsw":intNumber of preemptions, i.e. context switches due to expired time slices, or when processes with higher priority were scheduled.
"sysc":intNumber of system calls. [2]
"ioch":intNumber of characters read and written. [2]
"rtime":intElapsed real time (ms). [2]
"ttime":intElapsed system trap (system call) time (ms). [2]
"tftime":intText page fault sleep time (ms). [2]
"dftime":intData page fault sleep time (ms). [2]
"kftime":intKernel page fault sleep time (ms). [2]
"ltime":intUser lock wait sleep time (ms). [2]
"slptime":intOther sleep time (ms). [2]
"wtime":intWait CPU (latency) time (ms). [2]
"stoptime":intTime spent in stopped (suspended) state. [2]
"brksize":intHeap size. [3]
"stksize":intStack size. [3]
- Note
[1] Not if /proc rusage is used.
[2] Only from (Solaris?) /proc rusage.
[3] Only from /proc PRS usage.
On some systems, only utime will be filled in.
- See also