Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## display percentage of committed memory in use, updating every minute - when this approaches 100% , bad things start to happen like process crashes due to lack of memory
- ## written after experiencing committed memory exhaustion caused by apparent section handle leak in wudfhost.exe for DisplayLink drivers yet process memory & commit of that process is not excessive
- while(1) { $commitPercent = Get-CimInstance Win32_OperatingSystem|select @{n='Commit %';e={ [math]::Round( ( $_.TotalVirtualMemorySize - $_.FreeVirtualMemory ) / $_.TotalVirtualMemorySize * 100 , 1 ) }}|select -ExpandProperty 'Commit %'; $mostHandles = Get-Process|Sort HandleCount -Descending|select -first 1; Write-Output "$(Get-Date -Format G) : Commit $commitPercent% ; Process $($mostHandles.Name) has $($mostHandles.HandleCount) handles" ; start-sleep 60 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement