[Live-devel] Struggling with a stange behavior

Ross Finlayson finlayson at live555.com
Fri Nov 21 21:11:31 PST 2014


> any client for each camera runs in a separate thread
> 
Note that you don't need to do this.  Instead, it is possible (and, in fact, much easier) to have multiple RTSP clients running in a single thread, using a single event loop.  Note how the "testRTSPClient" code does this.


> Valgrind tells me that memory leaks (or something else that lost bytes) are found: 60 bytes direct, 20.000 indirect bytes are lost in the thread,
> 
>  in the H264BufferdPackedFactory::createNewPacket(...) by ReorederingPacketBuffer::getFreePacket() by SocketDescriptor::tcpReadHandler() by BasicTaskScheduler::singleStep().
> 
> I'm going crazy. Why this behaviour in this case?
> 

I don't know, but I wouldn't pay too much attention to the details in "valgrind" reports; they're notoriously unreliable.

But in any case I suggest reimplementing your application as a single-threaded application (as noted above).  Not only will it be simpler, but it'll be easier to debug.

(Alternatively, if your clients are truly independent, then you should also consider running each client as a separate *process* (i.e., as a separate running instance of an application).)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/ <http://www.live555.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141122/244da936/attachment.html>


More information about the live-devel mailing list