WhatsUP Out of memory exceptions may occur when you run an application with WMI provider

Posted by Cereal Tuesday, May 26, 2009 7:00:00 AM Categories: _Tous les articles WhatsUP
Rate this Content 0 Votes

SYMPTOMS :
Out of memory exceptions may occur when you run an application with WMI provider .Get("Win32_Process") and method .Methods_("Create") that is built by using the .NET Framework 2.0 in a high-load environment



Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date:  26.05.2009
Time:  03:45:05
User:  N/A
Computer: 
Description: 
EventType clr20r3, P1 logparser.exe, P2 1.0.0.18886, P3 4a13cd7d, P4 mscorlib, P5 2.0.0.0, P6 471eb8e7, P7 1c8, P8 42, P9 system.outofmemoryexception, P10 NIL.

CAUSE :
This problem occurs because the .NET garbage collector (GC) does not always dispose of WMI objects immediately

RESOLUTION :  

Automatic :
  
Copy/paste the code to a VBS file.



'Main function of SCRIPT
Dim locator, wmi, quota
Dim iMemoryValueMb
'The memory value do you want to set
iMemoryValueMb = 512

Set locator = CreateObject("WbemScripting.SWbemLocator")
Set wmi = locator.ConnectServer("", "root")

'Get instance __providerhostquotaconfiguration=@
Set quota = wmi.Get("__providerhostquotaconfiguration=@")
'message
WScript.Echo "Memory before change : " & quota.MemoryPerHost

'Set memory value
quota.MemoryPerHost = iMemoryValueMb * 1024 * 1024
'Save memory value
quota.put_()

'message
WScript.Echo "Memory after change : " & quota.MemoryPerHost
WScript.Echo "!!!! Restart conputer !!!!"



Manual :
     
Solution based from from : ASKPERF – Ask performance Team

1. Go to Start--> run and type “wbemtest.exe“
2. Click Connect on the “Windows Management Instrumentation Tester”
3. In the namespace text box just enter “root” (without quotes)
4. Click Connect


 
5. Click “Enum Instances…”


 
6. In the Class Info dialog box enter Superclass Name as “__ProviderHostQuotaConfiguration” (without quotes) and press OK.


 
7. A query Result window will come up. In this windows now double click “__ProviderHostQuotaConfiguration=@” (without quotes)


 
8. An Object Editor windows will come up now
9. Under properties find the property "MemoryPerHost" or any other ones you need to modify and double click it


 
10. Change the value to “512 MB” which is “536870912” (without quotes)
11. Click “Save Property”
12. Click “Save Object” in the “Object Editor window“
13. Close the other windows now and exit “WMI Tester”
14. Restart the computer.

MORE INFORMATIONS :
ASKPERF - http://blogs.technet.com/askperf/archive/2008/09/16/memory-and-handle-quotas-in-the-wmi-provider-service.aspx
http://support.microsoft.com/kb/912884/en-us
http://msdn.microsoft.com/en-us/library/aa394671.aspx
http://blogs.technet.com/askperf/archive/2008/09/16/memory-and-handle-quotas-in-the-wmi-provider-service.aspx
http://madhanarcot.blogspot.com/2008/06/out-of-memory-errors-while-enlisting.html
http://support.microsoft.com/kb/912884/en-us

Simple-Tech.info
Comments are closed on this post.
Site Map | Printable View | © 2008 - 2012 Simple-Tech.info | Powered by mojoPortal | HTML 5 | CSS | Design by mitchinson