Editing
Linux commands
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Obtaining Memory Usage through top command ==== {{Mac}} (known as [https://zh.wikipedia.org/zh-tw/Darwin_(%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F) Darwin]): * command: {{kbd | key = top -l 1 | grep PhysMem:}} * output example: PhysMem: 8017M used (1486M wired), 172M unused. * memory usage: 172 / (8017+172); unit: % {{Linux}} or {{Mac}} * command: {{kbd | key = top}} (and press q key to quit the top window) * output example: The Python process with the Process ID (PID) 13086 is utilizing 22.19 GB of memory, as indicated by the value in the RES (Resident Set Size) field. <pre> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13086 account 20 0 132.1g 22.19g 13.0g S 42.9 17.6 30:33.61 python </pre> * PID: Process ID, 13086 in this case, which is the unique identifier for the process. * USER: The user that started the process, account here. * PR: Priority of the process in the kernel's scheduler. The value 20 indicates a regular priority. * NI: Nice value, which influences the priority (0 by default, meaning no adjustment to the scheduling). * VIRT: Virtual memory size, 132.1g for this process, which is the total amount of virtual memory used by the process. * RES: Resident memory size, 22.19g here, showing how much physical memory the process is currently using. * SHR: Shared memory size, 13.0g in this case, which is the memory this process is sharing with others. * S: Process status, S here which usually means 'sleeping'. * %CPU: CPU usage, 42.9 indicating the percentage of the CPU time the process is currently using. * %MEM: Memory usage, 17.6 showing the percentage of total physical memory used by the process. * TIME+: Total CPU time the process has been running, 30:33.61 indicates 30 minutes and 33.61 seconds. * COMMAND: The command that initiated the process, python here.
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information