On Jan 10, 2008 8:23 AM, Richard Freeman &lt;<a href="mailto:r-mythtv@thefreemanclan.net" target="_blank">r-mythtv@thefreemanclan.net</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>Marc wrote:<br>&gt; I&#39;m running a SVN(15354) frontend/backend on Gentoo with 32 bits and I&#39;m not<br>&gt; seeing this problem.<br>&gt; asgard ~ # free -m<br></div>&nbsp;&gt; snip...<br><br>I just noticed these posts. &nbsp;If you&#39;re concerned about memory leaks /
<br>etc looking at the output of free is just about useless. &nbsp;Look at how<br>much memory individual processes are taking up instead.<br><br>It is completely normal for a linux system with 500GB of memory and at<br>least as much hard drive space to swap to disk, and report most of the
<br>memory as in use just about all the time.<br><br>The reason memory seems to be always in-use is that &quot;free&quot; memory in<br>linux is memory that is not being used AT ALL for any purpose. &nbsp;Linux<br>tries to minimize the amount of completely-unused memory - preferring to
<br>use it for buffering or cache. &nbsp;When the memory is needed the cache is<br>purged and the buffers are flushed. &nbsp;This only improves system<br>performance by reducing disk access. &nbsp;If memory isn&#39;t needed for<br>something else you might as well use it as cache - it doesn&#39;t cost
<br>anything as cache can be instantly purged to be made available.<br><br>The reason swapping happens all the time on linux is because of the<br>&quot;swapiness&quot; setting. &nbsp;If a page of memory seems to be idle for a very
<br>long time the system will swap it out when it is otherwise not busy to<br>make more room for cache/buffers. &nbsp;The assumption is that something else<br>will need that memory before the idle app does, or that caching will
<br>generally improve performance. &nbsp;So even if there is free memory the<br>system will swap out empty pages. &nbsp;This behavior can be tuned with a<br>setting in /proc if necessary.<br><br>A memory leak is when an application allocates memory and then doesn&#39;t
<br>use it, or stops using memory but doesn&#39;t free it. &nbsp;It causes an<br>application&#39;s virtual memory use to grow, but its real memory use does<br>not necessarily grow as much (because of the aforementioned swappiness -
<br>linux just swaps the dead pages out to disk and never reads them back).<br> &nbsp;The ability to swap dead pages would probably depend on whether the<br>wasted memory fills entire pages - it still isn&#39;t ideal.<br><br>
I haven&#39;t observed memory leaks on my 64bit gentoo system, or on my
<br>32-bit frontend (with about 200MB available RAM and no swap). &nbsp;I have<br>increased my buffer sizes on my backend, so that can consume a fair<br>amount of virtual memory - but nothing really more than expected.<br><br>

When my myth system is slow I&#39;ve found that the usual cause is IO<br>contention. &nbsp;Swapping contributes to this in part, but only in part.<br>The iostat tool can help troubleshoot this. &nbsp;The ionice tool can help<br>mitigate this. &nbsp;I run the backend with a medium realtime ioniceness
<br>setting - this allows the backend access to the disk just about anytime<br>it needs it without waiting &nbsp;in line. &nbsp;That and increasing my buffers<br>and getting rid of the buffer fsync have completely eliminated by<br>

IOBOUND issues.<br><br>In any case, the way to spot a memory leak is looking at the output of<br>top or ps -o args,vsz,rss -u mythtv (or whatever). &nbsp;Sorting top by<br>memory use is a good way to find out where all your RAM is going. &nbsp;You
<br>might be surprised to find out that it is something else entirely.<br><div><div></div><div><br>_______________________________________________<br>mythtv-users mailing list<br><a href="mailto:mythtv-users@mythtv.org" target="_blank">

mythtv-users@mythtv.org</a><br><a href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users" target="_blank">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a><br></div></div></blockquote></div><br><br><br>I understand how linux does its memory usage and what not.&nbsp; But i am not talking about using alot of my memory and it being &#39;slower&#39;.&nbsp; When I say slow the mouse wont even move fluidly.&nbsp; It jumps 1/2 way across the screen as i move it.&nbsp; I look at htop and see mem usage is 100% and swap is 1000/2500m used.&nbsp; The usage of swap increases the longer I leave the frontend open.&nbsp; Looking at memory to processes correlation I see the mythfrontend processes each taking 
9.4% of memory.&nbsp; And when there are 15 processes going for mythfrontend it eats everything up.&nbsp; When I killall mythfrontend the problem gets better.&nbsp; I can atleast run the frontend with some experience but the only way to really get a fast userspace is to reboot.
<br><br><br>Again I am using atrpms bleeding packages which are SVN r15333.&nbsp; I believe this my be a x86-64 issue.&nbsp; As my 32bit works fine with the same packages.&nbsp; both are F8 fully updated boxes.<br><br>How do i got about figuring out where the issue is?&nbsp; I am not the only one seeing this problem and its a SERIOUS one!
<br><br>If a Dev would like to take a look I would have no problem giving user shell access to the box.&nbsp; <br><br>Thanks,<br>Mitchell<br>