[Live-devel] Seeing small handle leak when repeatedly starting and stopping event loop

Erlandsson, Claes P (CERLANDS) CERLANDS at arinc.com
Wed Sep 18 14:39:16 PDT 2013


To verify if the handle leak I've noticed is in my code or in liveMedia I
wrote a really simple program that just start and stops the event loop. I
took the latest testRTSPClient.cpp and just replaced main() with a loop that
initiates a thread which starts the event loop - StartEventLoop(). The main
thread sleeps for 2s and then sets eventLoopWatchVariable making the thread
exit. No streams are started, it's just the event loop going up and down.

 

Code attached (testLiveMediaUpDown.cpp). I compile it using VC++; threading
probably needs to be adjusted if using other compiler/OS.

 

If I run this and monitor handles used I can see that the handles are
incremented by one each time the event loop runs. This can e.g. be done
using SysInternal's "Process Explorer" (handle column not on by default).
Looking at the handle type I can also see it's the "\Device\Afd" handles
that are increasing. I believe "Afd" stands for Auxiliary Function Driver
and that it's related to sockets, but "Afd" is new to me as I've have never
come across it before.

 

 

Any idea where that handle leak originates? Could it be Windows specific?

 

 

/Claes

 

From: Erlandsson, Claes P (CERLANDS) 
Sent: Friday, July 19, 2013 11:20 AM
To: 'live-devel at lists.live555.com'
Subject: Seeing small handle leak when repeatedly starting and stopping
event loop

 

When I start and stop the liveMedia event loop I see a small handle leak in
my Windows test client. When looking in Process Explorer I can see the
amount of file handles with the name "\Device\Afd" growing.

 

I don't have to stream anything for it to occur, i.e. I just start the event
loop and then bring it down by setting the flag to 1. It is very possible
it's due to some needed cleanup I'm missing.

 

After leaving doEventLoop I delete my trigger(s), call env->reclaim() and
delete the TaskScheduler.

Is there anything else that should be done?

 

 

/Claes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130918/1d064753/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testLiveMediaUpDown.cpp
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130918/1d064753/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5739 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130918/1d064753/attachment-0001.bin>


More information about the live-devel mailing list