[mythtv-users] how to make 0.24 more like 0.21 ?

Jay Ashworth jra at baylink.com
Wed Oct 26 19:14:34 UTC 2011

----- Original Message -----
> From: "Roger Horner" <mythtvuser1818 at gmail.com>

> > On Wed, Oct 26, 2011 at 10:17 AM, Tyler T <tylernt at gmail.com> wrote:

> > So far it looks like turning off swap (the machine has 1G of RAM and
> > Mythbuntu set up an additional 1G of swap) fixed it.
> > Kinda strange, since before it was using something like 700M RAM
> > plus 800M swap, and now it's just using 900M RAM.
> >
> Interesting! On my previous system (which only had 512MB RAM) I often
> guessed that the stuttering was caused by it swapping out to disk, but
> I always thought that problem was I didn't have enough RAM (which may
> also have been true in my case). In my current system (which has 2GB RAM),
> I have noticed that if it has been on for a while, almost all the RAM
> will be used and a small amount of swap is also used, which has always seemed
> strange to me.
> I seem to remember reading that MythTV will fill up all unused RAM
> with a buffer of recently recorded video to save on disk reads if another
> process needs it. I wonder if there is a bug where when there is need for more
> RAM it gets it from swap before freeing up space from this buffer? I think
> I will turn off my swap space and see what happens (I only added it
> because it seemed like a good idea at the time).

You might want to reconsider.

Unlike Windows, on which the rule is "swap early and often", and where that 
particular tradeoff might be worthwhile, on Linux, processes are not paged
out until there's no memory left, in general.

The reason the free space indication goes down is that Linux tends to allocate 
most unused space for its buffer cache, adjusting as necessary when the ram 
is needed for programs.

512MB really *isn't* enough ram, but if that's all you have, you'd better leave
swap enabled, or you'll run out of memory and things will start getting killed.

I would venture to speculate that, given the wide penetration of the Linux kernel,
its memory management code has fewer bugs than the average module in most other
programs (IE: if it was going to swap with ram available, that would have been
a brown-paper-bag bug, found and fixed before release.

If you haven't already done it, making sure your OS and SQL are on one 
physical drive, and your video on another, is probably the easiest solution
to disk contention problems.

If that entails moving things to a new small drive, put the swap partition 
*in the middle*.

-- jra
Jay R. Ashworth                  Baylink                       jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com         2000 Land Rover DII
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274

More information about the mythtv-users mailing list