Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

handle leakage

1 view
Skip to first unread message

linuxfedora

unread,
Dec 18, 2009, 3:54:17 AM12/18/09
to
Hi All,

I found that my application has handle leakage, and i used Windbg to
check my application, and found that the type of handle that incresing
a lot is the Process type, but what could be the API that will create
a Process type handle?Thanks.
My program is written in C# + MFC ActiveX. Thanks

Wilson, Phil

unread,
Dec 18, 2009, 12:35:09 PM12/18/09
to
CreateProcess?
--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"linuxfedora" <linux...@yahoo.com.hk> wrote in message
news:7f0cae4b-250e-44c5...@2g2000prl.googlegroups.com...

linuxfedora

unread,
Dec 18, 2009, 8:33:25 PM12/18/09
to
But my source code has no CreateProcess function.

On 12月19日, 上午1時35分, "Wilson, Phil" <ph...@wonderware.nospam.com>
wrote:


> CreateProcess?
> --
> Phil Wilson
> The Definitive Guide to Windows Installerhttp://www.apress.com/book/view/1590592972
>

> "linuxfedora" <linuxfed...@yahoo.com.hk> wrote in message

Peter Duniho

unread,
Dec 18, 2009, 8:42:29 PM12/18/09
to
linuxfedora wrote:
> But my source code has no CreateProcess function.

Well, then you must not have a leak! Code fixed!

Seriously though, anything in your code that deals with processes
_might_ be responsible for the leak. But if you don't post the code
that causes the leak, there's no way for anyone else to suggest what the
problem might be.

CreateProcess() is an unmanaged function in the Win32 API that creates a
process. Of course, it's possible that you are calling that function
indirectly by using the Process class, or CreateProcessEx() (a similar,
newer function), or that you are somehow getting a process handle for an
already-existing process, or...

There are lots of choices. On the face of it, your question appears to
have nothing to do with .NET or C#. If you think it is related to .NET
or C#, post a concise-but-complete C# code example that reliably
demonstrates the problem.

Pete

not_a_commie

unread,
Dec 19, 2009, 10:55:17 AM12/19/09
to
Are you closing your database and network connections? Are you
disposing of your ActiveX objects when done? Would the leak be in the
ActiveX object you are using? Can you cache the ActiveX object and
reuse the same instance? Does ProcessExplorer give you any information
about the handles being leaked? You might find something useful here:

http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/b5b7a179-3737-4380-b6cf-843f3e71b317

0 new messages