Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer key for trace; MemoryUsage1.etl #9

Open
itoleck opened this issue Aug 18, 2023 · 0 comments
Open

Answer key for trace; MemoryUsage1.etl #9

itoleck opened this issue Aug 18, 2023 · 0 comments
Assignees
Labels
answer key Answers for practice traces

Comments

@itoleck
Copy link
Owner

itoleck commented Aug 18, 2023

Scenario:

A Windows Server is showing memory usage fluctuations in Task Manager.

Analysis:

The first thing to check when dealing with memory usage situations and something I like to check in all traces where the overall memory usage is captured is to look at the amount of RAM .vs the overall memory commit usage. If the commit usage is more than RAM, then the machine is utilizing the paging file, which is slower than RAM. If this condition persists, the RAM should be upgraded on the machine if possible.

Open the Memory panel on the Graph Explorer and open a new Memory Utilization analysis window.

Memory

Since the Total Physical Memory (RAM) is larger than the Commit (Total), the server's overall memory usage is within an acceptable amount. If the Total Physical Memory (RAM) was less than the Commit (Total) that would indicate that the server needs more RAM installed for best performance.

Memory

There are some other memory related graphs available in the Graph Explorer. Add the VirtualAlloc Commit LifeTimes graph to an analysis window.

Memory

In the analysis window, sort by the Size (MB) column if it is not already sorted. The carat above the column name indicates that the column is sorted. View the processes responsible for the memory usage. The memory usage is also graphed, and you should see the memory spiking throughout the trace period.

Memory

The processes responsible for the memory spikes are powershell.exe. The process IDs (PID) are different for each, so these are all separate processes. It may help to know what command was issued when the powershell.exe was called so that we know if there was any script ran in the command arguments. This information is available in the System Activity panel in the Graph Explorer.

Memory

Open the Processes graph in an analysis window. The column grouping by default is by Lifetime, then Process. The Lifetime column indicates when the process ran. If it is Transient that means that the process started and stopped within the trace period. A permanent process lifetime indicates that the process started before the trace period. All of the powershell.exe processes that have memory usage spikes are transient.

A good analysis view is shown below; with the memory graphs and process graphs in the same analysis tab, filtered and sorted by the powershell.exe process. When you select each powershell.exe process, you will also select the memory spike that correlates to the process.

In the VirtualAlloc Commit LifeTimes graph there are also columns available for Type and Impacting Stack (Frame Tags). The Type will show that the memory allocations were Allocated Inside Freed Inside (AIFI), this means that the memory was used and cleaned up during the trace period. This is usually indicative of normal memory usage. Look for processes that are (AOFO) or (AIFO) when looking for memory leaks.

Memory

The Impacting Stack (Frame Tags) column is n/a which indicates that no stack information for the memory allocations is available. This can be verified by looking in the System Configuration -> Trace Statistics window. In this case there are StackWalk events captured in the trace. There are other reasons that the stack may not be available, in this case it is because the trace is missing the ImageId Provider trace events. A new trace would have to be taken with the correct providers to understand more about the functions called in the powershell.exe processes.

Memory

Below is a good example of the trace events with ImageId and StackTrace events.

Memory

Remediation:

No remediation needed, but if the PowerShell.exe processes that capture performance information become an issue; stop the collections.

@itoleck itoleck added the answer key Answers for practice traces label Aug 18, 2023
@itoleck itoleck self-assigned this Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer key Answers for practice traces
Projects
None yet
Development

No branches or pull requests

1 participant