[mythtv-users] ticket locking
jruss at mit.edu
Thu Jun 19 17:34:01 UTC 2008
> The system starts, mythbackend loads and runs.
> We are at 9.x% or so on my 1GB system.
> Yes, these numbers are from memory.
> You explain why that number can easily quadruple over time for and for
> waht reason. Buffers are allocated at startup. Just three channels are
> recorded, 6 at maximum at any time (pre- and postroll).
> So until this max usage is hit it can grow.
> If the process continues to grow after this occasion we might have an
> If the process continues to grow at an abnormal rate we might have an
> (yes, opinions and they're mine)
> > I guess I should consider all the processes on my PC to be leaking
> > memory because they all pretty much do that.
> All your process grow steadily into the double digit numbers?
> So your RAM fills up or your swap does or both?
The memory on your computer is a cache system (see:
http://en.wikipedia.org/wiki/Cache). Its job is to fill up with anything
that gets pulled from the disk or written to memory by the CPU. It is then
supposed to hold that stuff in RAM until the space is needed by another
process (this is over simplified but it is the general idea). Contrary to
popular belief, having your system sit there with a lot of free RAM is not
good for system performance. Ideally anything the process might need would
be waiting in RAM rather than having to fetch it from disk. If you are only
running mythtv and you have 1 GB of RAM then mythtv should take up as much
of that RAM as it wants over time, since no other processes need it. So just
using more RAM over time does not necessarily mean there is a leak.
You seem to be under the impression that there is some small portion of the
code that deals with the memory access and that it would be easy to identify
what is causing a leak (if there is one). Every single part of the mythtv
code is resident in memory before it runs. While any aspect of the program
is running it allocates memory and then it deallocates it when it is no
longer needed. A leak occurs when memory gets allocated, but when it is
finished being used it doesn't get deallocated. So a leak could be coming
from almost any aspect of the program. To increase the complexity the
software is calling device drivers, system functions, etc. that are not part
of mythtv. These likewise are allocating and using memory. It is often very
difficult to determine when a given chunk of memory is no longer needed and
should be deallocated. In terms of complexity, variables, and the number of
interactions, there are few things more complicated that trying to trace
this type of information through a modern software/computer system.
I would recommend you stop suggesting how simple this should be to fix. It
is fine that you don't understand what is involved, but you should be
willing to acknowledge that and stop suggesting, to those who do know, that
they should 'simply' replicate your environment, find the bug, and fix it.
Any of those steps is more often the not incredibly difficult. They best bet
for identifying the bug is to use your system. It is the only place that it
is guaranteed to be present.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mythtv-users