> For the complete documentation index, see [llms.txt](https://chunhthanhde.gitbook.io/google-learning-programs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chunhthanhde.gitbook.io/google-learning-programs/google-it-support-professional-certificate/course-3-operating-systems-and-becoming-a-power-user/module-5-process-management/3.process-utilization/1.windows-resource-monitoring.md).

# Windows Resource Monitoring

In an IT support role, managing processes is essential, particularly when system processes become unstable or resource-heavy. Windows provides tools to monitor system resources, including **Resource Monitor** and **Get-Process** via PowerShell. Below is a breakdown of how these tools work.

### 🔍 **Resource Monitor**

Resource Monitor provides a graphical interface to observe system resources and manage processes. It offers five main tabs:

1. **Overview** - Displays an overview of all system resources.
2. **CPU** - Information about CPU usage by processes.
3. **Memory** - Data on how processes utilize system memory.
4. **Disk** - Monitoring of disk activity per process.
5. **Network** - Details on network activity by processes.

Each tab shows processes and their resource consumption, such as CPU usage, memory (indicated by Private Bytes), and disk IO (input/output).

### ⚙️ **Command-Line Resource Monitoring**

For users who prefer the command line, **PowerShell** offers the `Get-Process` command. This command retrieves detailed information about each running process, including non-paged memory (NPMK) in kilobytes (K). To further refine the information, users can filter processes using pipes (`|`) and sorting commands. Here’s an example of how to display the top 3 CPU-consuming processes:

```powershell
Get-Process | Sort-Object CPU -Descending | Select-Object -First 3 -Property ID, ProcessName, CPU
```

### 💡 **Explanation of Command**

* `Get-Process` – Retrieves all running processes.
* `| Sort-Object CPU -Descending` – Sorts processes by CPU usage in descending order.
* `| Select-Object -First 3 -Property ID, ProcessName, CPU` – Displays only the top three processes based on CPU usage, showing their ID, name, and CPU consumption.

### 📈 **Process Explorer**

In addition to Resource Monitor, Windows also offers **Process Explorer** to visualize process performance. By selecting a process and viewing its properties, users can see real-time performance graphs of:

* **CPU** activity.
* **Memory** usage (Private Bytes).
* **Disk IO** activity.

### 🧠 **Key Takeaways**

* **Resource Monitor** provides a graphical way to manage processes.
* **PowerShell's Get-Process** allows command-line resource monitoring and filtering.
* **Process Explorer** offers detailed performance insights for each process.
* Effective process management helps troubleshoot performance issues and optimize resource use.

***

## 🐧 **Linux Resource Monitoring**

In **Linux**, several commands allow you to monitor system utilization and manage processes effectively. Understanding and using these commands is crucial for troubleshooting performance issues. Below is a breakdown of key commands and how they help manage system resources.

### 📊 **`top` Command**

The `top` command provides real-time monitoring of system resources. It displays the top processes consuming the most resources, offering insights into:

* **Total tasks**: Running or idle.
* **CPU usage**: Percentage of CPU resources being used.
* **Memory usage**: Percentage of memory resources used by each task.

#### Key Fields:

* **%CPU**: Shows the CPU usage of individual tasks.
* **%MEM**: Shows the memory usage of individual tasks.

**Usage Tip**: Press `q` to exit the `top` command.

### ⚙️ **Common Scenario: High Resource Usage**

When a computer is running slowly, it’s often due to **overuse of hardware resources**. Use `top` to identify any tasks with high CPU or memory usage. If necessary, you can investigate or terminate these processes to free up resources.

### ⏲️ **`uptime` Command**

The `uptime` command provides essential system information, including:

* **Current time**.
* **How long the system has been running**.
* **Number of logged-in users**.
* **System load averages**: Displays CPU load over the past 1, 5, and 15 minutes.

This is useful for assessing system performance over time, especially when monitoring load fluctuations.

### 📂 **`lsof` Command**

The `lsof` (List Open Files) command helps track processes that are using files. For example, if you can’t eject a USB drive because the system reports "device or resource busy," `lsof` can identify which processes are holding open files on the device.

```bash
lsof | grep /path/to/device
```

This command is highly effective for managing open files and resolving issues like blocked USB ejection.

### 💻 **Hardware Monitoring**

If you’re interested in monitoring CPU or memory usage independently of processes, Linux offers various commands for that purpose. These may not be critical for single-machine monitoring, but they become valuable when managing **multiple machines** or a fleet of systems.

### 🧠 **Key Takeaways**

* The **`top`** command is invaluable for real-time process monitoring.
* **`uptime`** provides load averages to track system performance over time.
* Use **`lsof`** to troubleshoot open file issues, especially with removable drives.
* Monitoring hardware separately from processes can be useful for system administrators managing many machines.
