locked
WebBrowser control resource leak RRS feed

  • Question

  • I'm working on a .NET application that loads web pages using multiple WebBrowser controls. There are several threads and WebBrowser controls involved (this is a server application, and the WebBrowser is required for capturing the rendered image), each thread creating a WebBrowser control and running a message loop for it.

    My question/issue is related to the WebBrowser control. Every time a web page is loaded, the (Windows) handle usage for the process increases. The WebBrowser controls are disposed when no longer needed, but for some reason the handle count doesn't seem to decrease. The application handle usage grows to more than 15000 in less than 10 minutes.

    While checking with Sysinternals Process Explorer I noticed most of the handles seem to be Thread handles (on a multi core server). On a single core machine it also reports lots of Event handles.

    Is the WebBrowser control known to be leaking handles ? And are there any methods to detect the cause of the handle leak ?

    (I tried WinDbg, but haven't had much success due to not having any experience in using it. Memory/Performance profilers don't reveal any managed resource leaks.)

    This is my first question here, please excuse any mistakes.

    • Moved by eryang Wednesday, November 4, 2009 3:01 AM (From:.NET Base Class Library)
    Monday, November 2, 2009 8:48 AM

All replies

  • Hi,
    Thanks for your post, the issue sounds like a WebBrowser control question, and it's likely to get quicker and better responses to ASP.NET issues at http://forums.asp.net where ASP.NET experts live in.

    Thanks,
    Eric

    Please remember to mark helpful replies as answers and unmark them if they provide no help.
    Wednesday, November 4, 2009 3:01 AM