Tips for monitoring memory consumption of an Azure function (or other) dll

To to monitor memory footprint for the dotnet.exe instance running ParquetImporter.dll, use PowerShell to filter on the command line.

Context: Windows Powershell, Visual Studio 2026 (Running locally in .NET development context)

Find the process

Get-CimInstance Win32_Process |
Where-Object { $_.Name -eq 'dotnet.exe' -and $_.CommandLine -match 'ParquetImporter\.dll' } |
Select-Object ProcessId, CommandLine

Show current and peak memory

Get-CimInstance Win32_Process |
Where-Object { $_.Name -eq 'dotnet.exe' -and $_.CommandLine -match 'ParquetImporter\.dll' } |
ForEach-Object {
Get-Process -Id $_.ProcessId |
Select-Object Id,
@{N='CurrentMB';E={[math]::Round($_.WorkingSet64/1MB,1)}},
@{N='PeakMB';E={[math]::Round($_.PeakWorkingSet64/1MB,1)}}
}

Continuously watch memory and track the maximum

$max = 0
while ($true) {
$pid = (Get-CimInstance Win32_Process |
Where-Object {
$_.Name -eq 'dotnet.exe' -and
$_.CommandLine -match 'ParquetImporter\.dll'
}).ProcessId
if ($pid) {
$p = Get-Process -Id $pid
$current = [math]::Round($p.WorkingSet64 / 1MB, 1)
$peak = [math]::Round($p.PeakWorkingSet64 / 1MB, 1)
if ($current -gt $max) { $max = $current }
Clear-Host
Write-Host "PID: $pid"
Write-Host "Current: $current MB"
Write-Host "Peak (Windows): $peak MB"
Write-Host "Max observed by script: $max MB"
}
Start-Sleep -Seconds 1
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *