Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > dotnet performance > august 2005 >

dotnet performance : Handles leak during remoting - how to release stubborn handle?


Dekel
8/14/2005 11:41:53 AM
Handles leak during remoting - how to release stubborn handle?

I see handle count increase every call to ProcessMessage
---
ServerProcessing spres = _next.ProcessMessage(
sinkStack,
requestMsg,
requestHeaders,
requestStream,
out responseMsg,
out responseHeaders,
out responseStream);
---

The handle in not released in the lifetime of the server
Few other resources seems to be related to this - such as:
Socket.OverlappedAsyncResult
Threading.Overlapped
Threading.WaitHandle.__WaitHandleProtector

The question is:
What should be done in order to release the handle (and the
resources)
Dinhduy Tran
8/15/2005 2:19:07 PM
Hi Dekel,

The handles are supposed to reclaim by GC automatically. However, when it
will be collected is a different question. You can use a scheduler/timer to
force GC manually, let say 5 minutes!

Dinhduy Tran
[CSDP/MCSD]

[quoted text, click to view]
Dekel
8/16/2005 2:53:13 AM
Thanks for your answer
We already solved part of the problem (The most problematic part)
Many problems seems to happen due to [STAThread] attribute on the
Main()
Once this was removed =E2=80=93 behavior improved dramatically:
1=2E Handles are released
2=2E Gen 1 collection reclaim all memory =EF=81=8A

BUT: It is Gen 1 =E2=80=93 not Gen 0
I still see the stack starting from "Socket.OverlappedAsyncResult"
I assume that it waits till Gen 1 collection due to Finalizers (not
sure though)

The question =E2=80=93 Should we enlist to some event and Dispose() the
objects?

Dekel
AddThis Social Bookmark Button