Questions tagged [handle-leak]

23 questions
13
votes
3 answers

odd handle leak

My application (base application is MFC interop with C++/CLI but it also contains a lot of C#, Windows Forms, WPF) has has a handle leak. Shortly after application start I can see the handle count in the task manager grow continuously (at a rate of…
bitbonk
  • 48,890
  • 37
  • 186
  • 278
8
votes
4 answers

How to avoid leaking handles when invoking in UI from System.Threading.Timer?

It seems like calling Invoke on a winforms control in a callback from a System.Threading.Timer leaks handles until the timer is disposed. Does anyone have an idea of how to work around this? I need to poll for a value every second and update the…
Davy8
  • 30,868
  • 25
  • 115
  • 173
7
votes
1 answer

socket handle leak in pyzmq?

Hi good people of StackOverflow. I'm using pyzmq and I've got some long-running processes, which led to a discovery that socket handles are being left open. I've narrowed the offending code down to the following: import zmq uri =…
Cari
  • 997
  • 1
  • 10
  • 16
6
votes
1 answer

Trouble displaying C# stack trace in WinDbg

I have a handle leak in a C# program. I'm trying to diagnose it using WinDbg using !htrace, roughly as presented in this answer, but when I run !htrace -diff in WinDbg I'm presented with stack traces that don't show the names of my C# functions (or…
Mike
  • 954
  • 6
  • 10
5
votes
1 answer

Determine number of GDI handles and USER objects

We developed a small test suite for our Windows Forms UI rendering engine which allows to measure performance and detect memory leaks while running test cases in an automated manner. Now we would like to check for handle leaks as well. On the…
Gene
  • 4,192
  • 5
  • 32
  • 56
4
votes
1 answer

Handle leak when exception is thrown inside task

I'm trying to understand a very strange handle leak that is occurring in an application. I've managed to isolate the problem in the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using…
JoaoSantos
  • 103
  • 1
  • 6
4
votes
5 answers

CreateFileMapping, MapViewOfFile, handle leaking c++

Background: I am trying to create a memory mapped file that can be accessed by multiple processes. In the below code I only put in the code that pertains to the question I currently have to make things simpler. According to msdn I should be able to…
longlostbro
  • 528
  • 2
  • 7
  • 24
3
votes
0 answers

WCF ReliableSession: Handle leak in Framework 4.5?

After installing the 4.5 runtime on some servers, we experienced many winsock-related errors. I tracked the issue down to a handle leak to \Device\Afd, when using WCF with ReliableSessions on .Net 4.5 runtime (not reproducible on 4.0). I wrote a…
AndyB
  • 41
  • 2
3
votes
1 answer

WebBrowser control leaks memory specifically when handling Click events

I am in Windows 7, .NET 4.5, IE10. I have a simple windows form application with a WebBrowser control. Every time the page navigates, I want to add a click handler. I notice that memory is leaking when I do this. I am in fact detaching the event…
TCC
  • 2,546
  • 1
  • 24
  • 35
2
votes
0 answers

Why my C# socket program has lots of \device\afd handles?

I've written a tcp socket prgram that working with sockets asyncoronously. This is some part of my code: public void main() { var e = new SocketAsyncEventArgs(); e.Completed += new EventHandler(e_Completed); …
Reza Akraminejad
  • 1,412
  • 3
  • 24
  • 38
2
votes
3 answers

Use of GetGuiResources

Is it a good idea to use GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS) at the start of WinMain, and before the last return to detect GDI leaks or, more specifically, objects I forgot to release?Also I'm currently wondering why the first call…
Zub
  • 53
  • 1
  • 5
1
vote
0 answers

Handles leak when loading/unloading FFMPEG library in Delphi

I currently have a problem loading/unloading the avfilter-7.dll from ffmpeg 4.22 (x86) using Delphi 2007 (also with Delphi XE3..same problem) Each loading / unloading process of the library causes a handles leak in Windows x64 Pro for which I…
Arcardia
  • 11
  • 2
1
vote
0 answers

can sychronization code cause handle leakage on svhost rpcss

i am running kind of proxy software on my win7 x64 system, one thing that makes me confused is the svhost -k rpcss process seems to face serious handle leakage, the handle leakage continue to increase, even it reaches to 100,000 in a few days, if i…
hugemeow
  • 7,777
  • 13
  • 50
  • 63
1
vote
2 answers

variable leaking between subprocesses in bash

Hi there everyone at stackoverflow I'm having an issue with a bash script running as a child with a variable conflict from my parent script. I have a subprocess that starts and pulls variables from the parent. What I have going on is that within…
Cfoote7
  • 375
  • 2
  • 3
  • 14
1
vote
1 answer

AdsConnection not closed?

Consider the following code: private static void GetData( string connectionString, DataTable dataFromDbf, string commandText ) where TConnection : IDbConnection where TCommand : IDbCommand { using( IDbConnection oConn =…
1
2