1. There are two memory leaks here.I write my programs following the test***streamer and free the memory as the following:
      if (sessionState.sink != NULL) sessionState.sink->stopPlaying();

      Medium::close(sessionState.rtcpInstance);
      Medium::close(sessionState.sink);
      Medium::close(sessionState.source);

      Medium::close(sms);
      Medium::close(rtspServer);
      delete sessionState.rtpGroupsock;

      delete sessionState.rtcpGroupsock;

      if(scheduler) delete scheduler;
      if(env) env->reclaim();

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.


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 :


      Detected memory leaks!
Dumping objects ->
{594258} normal block at 0x003CC818, 32 bytes long.
 Data: <l G             > 6C 0F 47 00 00 00 00 00 00 00 00 00 00 00 00 00
{594245} normal block at 0x00B49008, 32 bytes long.

 Data: <l G             > 6C 0F 47 00 00 00 00 00 00 00 00 00 00 00 00 00

I am sorry that It may be difficult for you to find out what resulted in this,but can you give me some suggestion?

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.

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.


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.

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?


Unfortunately not; I can (in general) help only with the unmodified supplied code.

--

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to