473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Handle Leaks

Ian
Hi,

Is anybody aware of problems in .NET where the handle count of an
application increases over time?

We have a server application that is hosted in a Windows Service and accepts
socket connections from distributes processes. Each connection then runs in
it's own thread.

We are having problems on a Windows 2003 Server machine which is running
Chinese Windows. The problem is that the handle count increases over a 7 to
10 day period to a point where it reaches the 10000 limit for a process and
crashes. We have other similar deployments that don't get this problem.

We have used Process Explorer to analyse the Thread types being held by the
process and threads of type 'Event' are the highest in number, with 'File',
'Mutant' & 'Thread' also increasing. These handle types increase at the same
rate during the time the system is running.

Any help would be greatly appreciated!

Ian
Aug 15 '06 #1
2 1967
Hello, Ian!

What thread count do you observe or how many connections are there?
How much memory server consumes?
Are these newly spawned threads with clients socket correctly disposed?

Also you can create stress tests ( connecting with great number of sockets on the
server ) and observe server resources count ( handles ) behavior ( increase/decrease ).

While stress testing you can use some profiling tool ( e.g. ClrProfiler ) to see what objects are not
properly disposed or not GCed.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Aug 15 '06 #2
Ian
Hello Vadym,

Thanks for your reply.

At the time of the crash the number of threads is at 1607. When the
application is started the number of threads is at approx 950. This is an
increase of around 65%. Other handle types (e.g. event, Mutex) also increase
by that amount during the time that the system is running.

The threads are spawned via Socket.BeginAccept callback.

We have tried to reproduce the problem via some stress tests but have failed
to do so to date. I will try using ClrProfiler to see if we can get any more
information from the live application.

Thanks
Ian

"Vadym Stetsyak" wrote:
Hello, Ian!

What thread count do you observe or how many connections are there?
How much memory server consumes?
Are these newly spawned threads with clients socket correctly disposed?

Also you can create stress tests ( connecting with great number of sockets on the
server ) and observe server resources count ( handles ) behavior ( increase/decrease ).

While stress testing you can use some profiling tool ( e.g. ClrProfiler ) to see what objects are not
properly disposed or not GCed.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot
Aug 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Maurice | last post by:
Hi there, I'm experiencing big memory problems on my webserver. First on an old RedHat 7.2 system, now on an other fresh installed Suse 8.2 system: Linux version 2.4.20-4GB...
0
by: Saravanan D | last post by:
Hello, I have python module which uses C++ extension modules. If I run the Python Module for a long time in an windows environment, Perfmon shows handle leaks in Python.exe. Is there any way...
2
by: Generic Usenet Account | last post by:
I have been using STL for a long time now, without any problems. Recently we generated a purification report on our software using Rational Purify, and we found some memory leaks. My colleague...
7
by: Ken Varn | last post by:
I am working in managed C++. I have a Mutex object in which I need to replace the Handle property with a new handle. The new handle is being constructed using Win32 CreateMutex call. I need to...
39
by: tydbowl | last post by:
I have a problem where the below code chunk causes handle leaks on some machines. The leak APPEARS to be handles to the registry key: HKCU\Software\Microsoft\Windows\CurrentVersion\Internet...
4
by: ali.jan | last post by:
Hi, It is trivial to load an assembly in a new Application Domain. Is there any way of loading an assembly in a new process? I tried using the Process class like this: Process p = new...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
2
weaknessforcats
by: weaknessforcats | last post by:
Handle Classes Handle classes, also called Envelope or Cheshire Cat classes, are part of the Bridge design pattern. The objective of the Bridge pattern is to separate the abstraction from the...
1
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I have a vb.net program that leaks handles as reported by task manager. After running for a couple of hours, task manager reports over 1000 handles, and it continues to grow. I think I am failing...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.