Address
304 North Cardinal St.
Dorchester Center, MA 02124
Work Hours
Monday to Friday: 7AM - 7PM
Weekend: 10AM - 5PM
Learn how to fix memory issues and subsequent crashes in WMI / WmiPrvse.exe by increasing available memory and handles
Since I started expanding my Zabbix scripts and templates for monitoring Windows Server instances – AD, IIS and SQL Server – I found WMI was failing more and more. WMI stopped working: WmiPrvse.exe
would just crash after hitting some memory limit of 512 MB. If you run into the same issue with Windows Management Instrumentation, here is how you can increase WMI Provider Service’s memory quota. Doing so resolved these issues.
Learn how to fix memory issues and subsequent crashes in WMI / WmiPrvse.exe by increasing available memory and handles. Optimize WMI performance and memory usage in Windows Server.
Windows Server logs WMI messages in Microsoft-Windows-WMI-Activity/Operational
. Monitor this log in Zabbix if you want to 🙂 .
First, to increase WMI memory (and in my case: handles) quota, execute the following in an elevated PowerShell session:
$oWMI=get-wmiobject -Namespace root -Class __ProviderHostQuotaConfiguration
$oWMI.MemoryPerHost = 1024*1024*1024
$oWMI.MemoryAllHosts = 2048*1024*1024
$oWMI.HandlesPerHost = 6144
$oWMI.put()
This increases MemoryPerHost to 1024*1024*1024 MB (1 GB) and MemoryAllHosts to 2 GB.
Using WMI in Group Policy? WMI Filters for Group Policy to manage Windows Server versions
These settings can be found in WBEMTEST by following these steps:
__ProviderHostQuotaConfiguration=@
“I chose to also increase the HandlesPerHost quota limit, from its default 4096 (as shown above) to 6144. You need to increase ThreadsPerHost if you see the following error message
Windows Management Instrumentation has stopped WMIPRVSE.EXE because a quota reached a warning value. Quota: ThreadCount Value: 260 Maximum value: 256 WMIPRVSE PID: 368892 Providers hosted in this process:
%windir%\system32\wbem\servercompprov.dll, %systemroot%\system32\wbem\cimwin32.dll
Next, you can move the process to run in the COM Infrastructure group, so it starts closely after RPCSS:
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Winmgmt -Name 'Group' -Value 'COM Infrastructure'
And last (but not least) move the Winmgmt service to a standalone Svchost process. Default level 4 (RPC_C_AUTHN_LEVEL_PKT):
winmgmt /standalonehost
Reboot or restart the Windows Management Instrumentation service and you’ll notice a more reliable WMI.
The source for this information, where I found it, is in cluberti.com’s post Make WMI more robust to large volumes of queries (Wayback Machine archived link). There is more on WMI @ Microsoft’s Tech Community.