By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,143 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,143 IT Pros & Developers. It's quick & easy.

Handle/Memory Leak in RegistryKey Class?

P: n/a
I seem to be experiencing a behavior on Framework 1.0 sp2 RegistryKey
class where the class is not releasing/closing named pipe winreg
handles to remote machines. The process continues to hold on to a
handle to the following pipe:
\Device\LanmanRedirector\<MACHINE>\PIPE\winreg

Even after explicitly calling Close() (which, according to the docs,
should not matter for a base key), and expliticly doing garbage
collections, I cannot seem to get rid of this pipe.

My app is accessing the registry on thousands of machines and is long
running, and this is not a desired behavior. Any thoughts/help?

example code:

RegistryKey rk = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
MACHINE) ;
rk.Close();
rk=null;
GC.Collect();
GC.Collect(); // just to allow finalizers, etc.
GC.Collect();

// using tools like SysInternal's Process Explorer shows the winreg
pipe to still be open
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.