D
Don Nell
Hello
Why is there a memory leak when this code is executed.
for(;
{
ManagementScope scope = new ManagementScope();
scope.Options.Username="username";
scope.Options.Password="password";
scope.Path.Path=@"\\pc\root\cimv2";
scope.Connect();
}
There is no leak if the username and password is blank and the computer is
in a domain. At first I thought it had something to do with Windows'
inablility to release more than 9 security context entries per 10 seconds
(see link below), but the leak still exist when I slow it down.
http://support.microsoft.com/default.aspx?scid=kb;en-us;890196
I also tried calling RpcMgmtEnableIdleCleanup() at startup and also forcing
any unused memory back to the operating system with SetProcessWorkingSetSize
but nothing helps. The Windows task manger always shows my application
consuming more and more memory until it finally crashes.
Thanks.
Don
Why is there a memory leak when this code is executed.
for(;

{
ManagementScope scope = new ManagementScope();
scope.Options.Username="username";
scope.Options.Password="password";
scope.Path.Path=@"\\pc\root\cimv2";
scope.Connect();
}
There is no leak if the username and password is blank and the computer is
in a domain. At first I thought it had something to do with Windows'
inablility to release more than 9 security context entries per 10 seconds
(see link below), but the leak still exist when I slow it down.
http://support.microsoft.com/default.aspx?scid=kb;en-us;890196
I also tried calling RpcMgmtEnableIdleCleanup() at startup and also forcing
any unused memory back to the operating system with SetProcessWorkingSetSize
but nothing helps. The Windows task manger always shows my application
consuming more and more memory until it finally crashes.
Thanks.
Don