Query Details

Find Processes With High Memory Usage

Query

// Use Case: Analyze and identify processes by their average, maximum, and minimum memory usage in order to pinpoint memory-intensive applications for optimization or troubleshooting purposes.
Process
| summarize AvgMemoryUsageBytes=avg(WorkingSetSizeBytes), MaxMemoryUsageBytes=max(WorkingSetSizeBytes), MinMemoryUsageBytes=min(WorkingSetSizeBytes) by ProcessName
| order by AvgMemoryUsageBytes desc
| project ProcessName, AvgMemoryUsageBytes, MaxMemoryUsageBytes, MinMemoryUsageBytes

Explanation

This query is designed to analyze processes based on their memory usage to help identify applications that use a lot of memory, which can then be optimized or troubleshooted. Here's a breakdown of what it does:

  1. Data Source: It starts by looking at data from a table or dataset called Process, which contains information about different processes running on a system.

  2. Calculate Memory Usage: For each process, it calculates three key statistics related to memory usage:

    • Average Memory Usage (AvgMemoryUsageBytes): The average amount of memory used by the process.
    • Maximum Memory Usage (MaxMemoryUsageBytes): The highest amount of memory used by the process at any point.
    • Minimum Memory Usage (MinMemoryUsageBytes): The lowest amount of memory used by the process.
  3. Group by Process: These calculations are grouped by the name of the process (ProcessName), so you get these statistics for each individual process.

  4. Order Results: The results are then sorted in descending order based on the average memory usage. This means the processes that use the most memory on average will appear at the top of the list.

  5. Select Columns: Finally, it selects and displays only the process name and the calculated memory usage statistics (average, maximum, and minimum).

In simple terms, this query helps you find out which processes are using the most memory on average, so you can focus on those that might need optimization or troubleshooting.

Details

Ugur Koc profile picture

Ugur Koc

Released: December 13, 2024

Tables

Process

Keywords

Process

Operators

summarizeavgmaxminbyorder bydescproject

Actions

GitHub