Python Resource Library resource usage functions

Python Resource Library resource usage functions

Resource Library Python

This module in python provides basic mechanisms for measuring and controlling system resources utilized by a program. And symbolic constants are used to specify particular system resources and to request usage information about either the current process or its children. If there is a syscall failure, the OSError is raised.

Resource Usage: These are some functions in the resource library of python which is used to retrieve resource usage information. resource.getrusage(who):
This function returns an object that describes the resources consumed by either the current process or its children as specified by the 'who' parameter. The fields of the return value each describe how a particular system resource has been used, e.g. amount of time spent running is user mode or number of times the process was swapped out of main memory For backward compatibility, the return value is also accessible as a tuple of 16 elements. INDEX FIELD RESOURCE 0 ru_utime time in user mode(float seconds) 1 ru_stime time in system mode (float seconds) 2 ru_maxrss maximum resident set size 3 ru_ixrss shared memory size 4 ru_idrss unshared memory size 5 ru_isrss unshared stack size 6 ru_minflt page faults not requiring I/O 7 ru_majflt page faults requiring I/O 8 ru_nswap number of swap outs 9 ru_inblock block input operations 10 ru_oublock block output operations 11 ru_msgsnd messages sent 12 ru_msgrcv messages received 13 ru_nsignals signals received 14 ru_nvcsw voluntary context switches 15 re_nivcsw involuntary context switches This function will raise a ValueError if an invalid who parameter is specified. It may also raise error exception in unusual circumstances.



This function returns the number of bytes in a system page. A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, described by a single entry in the page table. It is the smallest unit of data for memory management in a virtual memory operating system.


More Articles of Arkaja Sharan:

Name Views Likes
Python codecs Library Error Handling schemes module functions 119 0
Python codecs Library Error Handler register_error and lookup_error functions 119 0
Python codecs Library Error Handlers 136 0
Python codecs Library open and EncodedFile functions 119 0
Python codecs Library iterencode and iterdecode functions 134 0
Python codecs Library register and unregister functions 102 0
Python codecs Library getreader and getwriter functions 119 0
Python codecs Library getincrementalencoder and getincrementaldecoder 103 0
Python codecs Library getencoder and getdecoder functions 113 0
Python Introduction to codecs Library 140 0
Python fcntl Library flock and lockf functions 122 0
Python fcntl Library fcntl and ioctl functions 140 0
Python Resource Library resource usage functions 124 0
Python Resource Library resource usage symbolic constants 105 0
Python Resource Library Resource Limit Functions 125 0
Python resource library resource limit symbolic constants 121 0
Python Introduction to Resource Library 130 0
Python stringprep Library in_table_d1 and in_table_d2 functions 116 0
Python stringprep Library in_table_c8 and in_table_c9 functions 111 0
Python stringprep Library in_table_c5 in_table_c6 and in_table_c7 functions 105 0
Python stringprep Library in_table_c3 and in_table_c4 functions 110 0
Python stringprep library in_table_c21 in_table_c22 and in_table_c21_c22 116 0
Python stringprep library functions in_table_c11 in_table_c12 and in_table_c11_c12 112 0
Python Introduction to stringprep Library 124 0
Python unicodedata library is_normalized unidata_version and ucd_3_2_0 111 0
Python Unicodedata Library functions normalize and decomposition 165 0
Python Unicodedata Library functions east_asian_width and mirrored 110 1
Python Unicodedata Library category bidirectional and combining functions 163 0
Introduction to Unicodedata library lookup and name functions 112 0
Unicode Library decimal digit and numeric functions 118 0
Introduction to Unicode Data library 0 0