[haiku-bugs] Re: [Haiku] #11752: BMediaFile leak (or leakS)

  • From: "ttcoder" <trac@xxxxxxxxxxxx>
  • Date: Fri, 13 Mar 2015 13:51:26 -0000

#11752: BMediaFile leak (or leakS)
-------------------------+----------------------------
   Reporter:  ttcoder    |      Owner:  nobody
       Type:  bug        |     Status:  new
   Priority:  high       |  Milestone:  R1/beta1
  Component:  - General  |    Version:  R1/Development
 Resolution:             |   Keywords:
 Blocked By:             |   Blocking:
Has a Patch:  0          |   Platform:  All
-------------------------+----------------------------

Comment (by ttcoder):

 Thanks for looking at this Barrett

 The sample code in 9945 is indeed only half the story; if I didn't mess up
 finding the right files in my archive, the missing bit looks like this:

 {{{
                 BMediaTrack * mediaTrack = mediaFile->TrackAt(0);  // will
 be Release()d in dtor

                 media_format decodedmediaformat;
                 memset( &decodedmediaformat, 0, sizeof(decodedmediaformat)
 );
                 decodedmediaformat.type = B_MEDIA_RAW_AUDIO;
                 ret = mediaTrack->DecodedFormat( &decodedmediaformat );

                 for( ;; )
                 {
                         char buf[8192] = { 0 };
                         int64 numread = 0;
                         ret = mediaTrack->ReadFrames(buf,&numread);
         //              printf( "got %Ld frames.. ", numread );
         //heap_debug_dump_allocations( true, find_thread(NULL));//
 fflush(stdout);

                         if( ret < 0 )
                                 break;
                 }
 }}}

 As to the third leak, dsuden's latest data (see above) shows it's not
 related to media_kit, it's more general in nature (even the Deskbar gets
 high mem usage after 10 days, north of 78 MB!) so I'll file another ticket
 for that one. And this one should be downgraded to normal priority by
 someone who has ticket edit privileges I suppose.

 Just gotta find the time to keep a computer up for 10 days, or find a
 better way to replicate what dsuden is seeing on our shipped systems..

--
Ticket URL: <https://dev.haiku-os.org/ticket/11752#comment:3>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: