To view the memory size occupied by a single process on a server, you can use system commands depending on the operating system.
ps command:
ps -o pid,rss,comm -p <PID>
pid: Process IDrss (Resident Set Size): Memory used by the process in kilobytescomm: Command nameExample:
ps -o pid,rss,comm -p 1234
top or htop command:
Run top or htop, then press Shift+M to sort processes by memory usage.
pmap command:
pmap -x <PID> | grep total
This provides a detailed memory map of the process.
Task Manager:
Ctrl+Shift+Esc), go to the "Details" tab, and check the "Memory (Active Private Working Set)" column.tasklist command:
tasklist /FI "PID eq <PID>" /FO TABLE /NH
(Note: This shows working set memory, not exact RSS.)
Process Explorer (Sysinternals tool):
A more detailed tool to inspect process memory usage.
If you're using a Tencent Cloud CVM (Cloud Virtual Machine), you can log in via SSH (Linux) or RDP (Windows) and use the above commands. For automated monitoring, Tencent Cloud provides Cloud Monitor (CM) to track process-level resource usage.
Example (Linux on Tencent Cloud CVM):
ps -eo pid,rss,comm | grep nginx
This shows memory usage for all nginx processes.
For long-term monitoring, integrate Tencent Cloud CM to set alerts on high memory consumption.