Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 28 Aug 2008 13:51:35 -0700 (PDT),    group: microsoft.public.win32.programmer.wmi        back       


Handle Leak on Windows 2003 Server x64   
I have a C++ WMI application that seems to be causing a handle leak on
Windows 2003 Server x64. The same application running on Windows XP
and Windows 2003 Server 32-bit doesn't exhibit any handle leaks (I
have the application running 24x7 on four XP SP2 machines and two 2003
32-bit machines without leaks). Are there any known issues specific to
Windows 2003 x64 that would cause a handle leak?

I've verified the handle leak by looking at the handle count steadily
increasing with time. It goes from ~200 to ~10,1000 over the span of
two days or so. The data is being pulled from:



Win32_PerfFormattedData_PerfOS_Processor
Win32_PerfFormattedData_PerfProc_Process
Win32_PerfFormattedData_PerfDisk_PhysicalDisk
Win32_PerfFormattedData_Tcpip_NetworkInterface



Couple of things I've found while trying to figure out this problem:

- If I stop collection from Win32_PerfFormattedData_PerfOS_Processor
(while letting the collection go on from the other classes), the
handle leak seems to be drastically reduced or pretty much stop.
There's no specific logic in the application to handle
Win32_PerfFormattedData_PerfOS_Processor. The code is pretty generic.
The system on which the leak occurs is an AMD x64 system with a single
physical CPU / dual cores.

- The reason I disabled Win32_PerfFormattedData_PerfOS_Processor was
because using Process Explorer, I found tens of registry keys open to
HKLM\SYSTEM\ControlSet001\SERVICES\PerfOS\Performance. I assume this
to be the source of leak. The program doesn't have any interactions
with the registry directly.



The main loop of the program is basically:

while(1)
{
	IWbemRefresher::Refresh()
	IWbemHiPerfEnum::GetObjects()

	if(firstTime)
		getPropertyHandles()


	Read Values for each property
        Sleep for a bit
}



Any ideas?


Thanks,
KS
date: Thu, 28 Aug 2008 13:51:35 -0700 (PDT)   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us