Handle/Memory Leak in RegistryKey Class?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • geek_in_a_box

    Handle/Memory Leak in RegistryKey Class?

    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\LanmanR edirector\<MACH INE>\PIPE\winre g

    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.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
    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
Working...