<br><br><div class="gmail_quote">2010/1/28 Ross Finlayson <span dir="ltr"><<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="im">
<blockquote type="cite"><tt> 1.
There are two memory leaks here.I write my programs following the
test***streamer and free the memory as the following:<br>
if (sessionState.sink != NULL)
sessionState.sink->stopPlaying();<br>
<br>
Medium::close(sessionState.rtcpInstance);
<br>
Medium::close(sessionState.sink);<br>
Medium::close(sessionState.source);<br>
<br>
Medium::close(sms);<br>
Medium::close(rtspServer);<br>
delete sessionState.rtpGroupsock;<br>
<br>
delete sessionState.rtcpGroupsock;<br>
<br>
if(scheduler) delete
scheduler;</tt></blockquote>
<blockquote type="cite"><tt>
if(env) env->reclaim();</tt></blockquote>
<div><br></div>
</div><div>What you are doing is correct (although, if you are planning to
rerun the same code once again, you could reuse the same
"UsageEnvironment" and "TaskScheduler" objects;
i.e., you would not need to delete them). However, why don't you
just run your code in its own process (i.e., as a separate
application)? That way, all of the memory that you allocated
will automatically be reclaimed.</div>
<div><br></div></div></blockquote><div> Thanks for your replay.I have never used a mailing list before so I dont't know how to <span id="reply_content_284421452">spilt </span> <br>
my question asked from your answer.I'm sorry about the trouble you may have in reading my <br>
email .Because I am using multiple thread here,so I have to reclaim the memory by myself.<br> Otherwise,there will be losts of memory leaks.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div>
<blockquote type="cite"><tt><br>
If I just create the
sinkĊAsourcĊArtspserver etc and don't startplaying,there will be no
memory leak.But if I add startplaying,after I close the server,there
will be two memory leaks :<div class="im"><br>
<br>
<br>
Detected memory leaks!<br>
Dumping objects -><br>
{594258} normal block at 0x003CC818, 32 bytes long.<br>
Data: <l
G
> 6C 0F 47 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
{594245} normal block at 0x00B49008, 32 bytes long.<br>
<br>
Data: <l
G
> 6C 0F 47 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
<br>
I am sorry that It may be difficult for
you to find out what resulted in this,but can you give me some
suggestion?</div></tt></blockquote>
<div><br></div>
<div>Does 64 bytes of extra memory get allocated each time you run
your code (i.e., in a loop), or does only 64 extra bytes get
allocated, no matter how many times you run your code? If it's
the latter case, then the problem doesn't seem serious.</div>
<div><br></div>
<div>However, you may be able to use "valgrind" (if you're
running on a Unix or Linux system) to help track down where this
memory allocation is coming from.</div>
<div><br></div></div></blockquote><div> The case is the former.My os is windows.Bad luck:) <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div>
<blockquote type="cite"><tt><br>
2.Sometimes esapcically after I restart
teh server,when I start my server and use VLC to play th stream,the
server receives the "DECRIBE"ĊA"SETUP" and
"PLAY"command ok, but VLC just doesn't play the stream and
it tears down a few seconds later.I don't know the reason.I use
openRTSP and try to save the stream into a file.Things are the
same.The connection between the RTSP server and openRTSP is ok,but
openRTSP can't receive any data,so the file is empty. Then I restart
the server for one or more times,everything goes all right.</tt><br>
<tt></tt></blockquote><div class="im">
<blockquote type="cite"><tt>
I rarely run into this problem with testprogs or
OnDemandRTSPServer.Therefore,there must be some reason that I have not
found in my program.Would you please help me?</tt></blockquote>
<div><br>
<br>
</div>
</div><div>Unfortunately not; I can (in general) help only with the
unmodified supplied code.</div>
<div><br></div></div></blockquote><div>I tested today and just found that if I run my server and VLC on the same pc,it didn't work for <br>serval times. If I run my server and VLC ont different computers,I did't run into this problem.It<br>
was strange.<br><br>Other quesitons:<br>I want to add the client's IP address and port into a list or arry once he connect to the server.So that after getting a frame,I can send it to all the client.Because my server and client may run over the iternet rather than LAN, I don't use multicast stream.Is it possible?<br>
Or can I follow the existed testOnDemandRTSPServer and write my own subclass of OnDemandServerMediaSubsessionto stream live source?If I can, should createNewStreamSource returns the same soure instead of FramedSource::createNew?<br>
<br>Thans for you time and answer.<br><br>Richy<br>Best regards<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><font color="#888888">
<pre>--
</pre>
<div><br>
Ross Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></div>
</font></div>
<br>_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br></blockquote></div><br>