[mythtv] hdtvrecorder: dynamic ringbuffers?

Doug Larrick doug at ties.org
Wed Dec 22 12:30:47 UTC 2004


John Patrick Poet wrote:
> 
> I have written a version of the hdtvrecorder ringbuffer code which 
> creates a variable number of ringbuffers, per recording.
> 
> Each ringbuffer is 20mb in size.  If a ringbuffer fills up, another 
> ringbuffer is created and all new data is written to it.  When the 
> filewriter empties a deprecated ringbuffer, it is deleted, and the 
> filewriter moves onto the next ringbuffer.  I have capped the maximum 
> number of simultaneous ringbuffers at 8.
> 
> The advantage of this system, is a much smaller memory footprint -- most 
> of the time.
> 
> The disadvantage is greater complexity, and a bit more overhead managing 
> the ringbuffers.
> 
> My question is, which would people prefer?

IMHO, and not having tried it, the new system sounds like a winner.  The 
only big problem I see is if the system goes into swap, it would spiral 
out of control needing more and more buffers as it struggles to keep up. 
  Perhaps detecting the amount of physical RAM in the system and 
limiting to (say) half of it (total) for ringbuffers would be the way to go.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20041222/3d39f943/signature.pgp


More information about the mythtv-dev mailing list