[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tracking down memory leaks



On 10/22/2015 08:23 AM, David Wright wrote:
Quoting Marc Shapiro (marcnshap@gmail.com):
On 10/20/2015 11:33 PM, Jörg-Volker Peetz wrote:
Marc Shapiro wrote on 10/21/2015 06:52:
<snip>
Something is not freeing up memory.  It may, or may not be Firefox, but...  I
can exit all programs and all instances of X, leaving only a single console
running.  Top will show itself and bash, nothing else, but free can show over
2GB used.  If I then reboot, free will show only about 250 MB used.  Obviously
something was tying up nearly 2 GB and it took a reboot to free it up.

Marc

Which version of free you are using?
Where does it show 2 GB?
Do the 2 GB comprise buffered and cached data?
Please, show the the output of free.
Don Armstrong had also suggested checking the cache and buffers,
which I had forgotten to do when I restarted.  I checked them
yesterday and, yes, that is where most of the memory was going after
I had exited all X sessions.  Google was my friend and showed me how
to free up that memory ('free && sync && echo 3 >
/proc/sys/vm/drop_caches && free' as root) and all is now good with
the world.

Thanks, everyone, for the help.  If I had just looked more closely
at the output of 'free' I could have done this myself.   (Forehead
slap).
I notice you've flagged this posting with SOLVED. However, I can't
find where you reported a problem. The original posting only says:

"I could run for months without having a memory problem. Now it's every
few days. When this happens,..."

So what was the problem? What happens?

My problem, or what I thought was a problem, was the 2+GB of memory that were still used after I had exited all X sessions and all but lone login session. As it turns out, most of that was just cache and buffers, which, as others have pointed out is not actually an issue, since it will be freed up and reused as necessary. I wasn't so much worried about actual memory being used in that way, the thing that bothered me was that I keep going into swap every few days. That is still happening if I don't keep an eye on the memory usage and then it starts thrashing and getting really slow

Now that I realize that the last 2GB is in cache and buffers, however, it is not quite such an issue. I close down my apps, and X (or just the browsers, since they are the worst offenders), clear the swap with a swapoff, followed by swapon, and restart all the stuff that I shut down. This clears up the swap usage, and usually 3 to 4 GB of real memory, as well. With the swap not in use everything gets back to running at reasonable speeds again.

Marc


Reply to: