pydoc > resource

📛 NAME

resource

🚀 Quick Reference

Use CaseCommandDescription
🔍 Check CPU time limitresource.getrlimit(resource.RLIMIT_CPU)Returns (soft, hard) limits for CPU time in seconds
📂 Set open file limitresource.setrlimit(resource.RLIMIT_NOFILE, (1024, 4096))Sets soft limit to 1024, hard limit to 4096 file descriptors
📊 Measure memory usageresource.getrusage(resource.RUSAGE_SELF).ru_maxrssReturns max resident set size in kilobytes
📄 Get system page sizeresource.getpagesize()Returns page size in bytes
👥 Limit another processresource.prlimit(pid, resource.RLIMIT_NPROC, (100, 200))Sets max processes for given PID
🧒 Child process usageresource.getrusage(resource.RUSAGE_CHILDREN)Returns cumulative usage of all terminated children

📚 MODULE REFERENCE

https://docs.python.org/3.10/library/resource.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

🏗️ CLASSES

builtins.tuple(builtins.object)

struct_rusage

📦 class struct_rusage(builtins.tuple)

struct_rusage: Result from getrusage.

This object may be accessed either as a tuple of

(utime,stime,maxrss,ixrss,idrss,isrss,minflt,majflt,nswap,inblock,oublock,msgsnd,msgrcv,nsignals,nvcsw,nivcsw)

or via the attributes ru_utime, ru_stime, ru_maxrss, and so on.

Method resolution order:

🔹 Methods defined here

🔹 Static methods defined here

🔹 Data descriptors defined here

🔹 Data and other attributes defined here

🔹 Methods inherited from builtins.tuple

🔹 Class methods inherited from builtins.tuple

⚙️ FUNCTIONS

📊 DATA

📁 FILE

/usr/lib/python3.10/lib-dynload/resource.cpython-310-x86_64-linux-gnu.so

resource
📛 NAME 🚀 Quick Reference 📚 MODULE REFERENCE 🏗️ CLASSES
📦 class struct_rusage(builtins.tuple)
⚙️ FUNCTIONS 📊 DATA 📁 FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 16:17 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^