Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #159042 > unrolled thread

Tracking down memory leaks

Started byMarc Shapiro <marcnshap@gmail.com>
First post2015-10-13 16:30 +0200
Last post2015-10-21 23:40 +0200
Articles 20 on this page of 21 — 11 participants

Back to article view | Back to linux.debian.user


Contents

  Tracking down memory leaks Marc Shapiro <marcnshap@gmail.com> - 2015-10-13 16:30 +0200
    Re: Tracking down memory leaks The Wanderer <wanderer@fastmail.fm> - 2015-10-13 16:40 +0200
    Re: Tracking down memory leaks Don Armstrong <don@debian.org> - 2015-10-13 17:00 +0200
      Re: Tracking down memory leaks Marc Shapiro <marcnshap@gmail.com> - 2015-10-17 18:10 +0200
        Re: Tracking down memory leaks Don Armstrong <don@debian.org> - 2015-10-18 22:00 +0200
          Re: Tracking down memory leaks Marc Shapiro <marcnshap@gmail.com> - 2015-10-21 07:00 +0200
            Re: Tracking down memory leaks Jörg-Volker Peetz <jvpeetz@web.de> - 2015-10-21 08:40 +0200
              Re: Tracking down memory leaks (SOLVED) Marc Shapiro <marcnshap@gmail.com> - 2015-10-22 16:30 +0200
                Re: Tracking down memory leaks (SOLVED) Nicolas George <george@nsup.org> - 2015-10-22 16:40 +0200
                  Re: Tracking down memory leaks (SOLVED) Cindy-Sue Causey <butterflybytes@gmail.com> - 2015-10-23 19:30 +0200
                    Re: Tracking down memory leaks (SOLVED) Nicolas George <george@nsup.org> - 2015-10-23 19:40 +0200
                    Re: Tracking down memory leaks (SOLVED) Lisi Reisz <lisi.reisz@gmail.com> - 2015-10-23 20:10 +0200
                      Re: Tracking down memory leaks (SOLVED) The Wanderer <wanderer@fastmail.fm> - 2015-10-23 20:40 +0200
                    Re: Tracking down memory leaks (SOLVED) Reco <recoverym4n@gmail.com> - 2015-10-23 20:20 +0200
                      Browser tabs, was Re: Tracking down memory leaks David Wright <deblis@lionunicorn.co.uk> - 2015-10-23 21:00 +0200
                Re: Tracking down memory leaks David Wright <deblis@lionunicorn.co.uk> - 2015-10-22 17:30 +0200
                  Re: Tracking down memory leaks Marc Shapiro <marcnshap@gmail.com> - 2015-10-24 08:30 +0200
                Re: Tracking down memory leaks (SOLVED) <tomas@tuxteam.de> - 2015-10-23 09:40 +0200
          Re: Tracking down memory leaks Michael Jones <mj@mikejonesey.co.uk> - 2015-10-21 23:40 +0200
    Re: Tracking down memory leaks Michael Jones <mj@mikejonesey.co.uk> - 2015-10-21 23:30 +0200
    Re: Tracking down memory leaks Michael Jones <mj@mikejonesey.co.uk> - 2015-10-21 23:40 +0200

Page 1 of 2  [1] 2  Next page →


#159042 — Tracking down memory leaks

FromMarc Shapiro <marcnshap@gmail.com>
Date2015-10-13 16:30 +0200
SubjectTracking down memory leaks
Message-ID<qj8Ku-KS-19@gated-at.bofh.it>
Is there a way to determine what is using up my memory?  I have an 8GB 
system and every few days the memory usage rises to over 7 GB and up to 
a GB, or more of swap is used.  Granted, I have 3 X sessions running, 
along with 2 instances of Firefox and one of Chrome, not to mention up 
to 3 instances of Libre Office, but... When I first added the 8 GB (I 
used to do this on 2.25 GB!) I could run for months without having a 
memory problem.  Now it's every few days.

When this happens, I exit all programs and shut down all three X 
sessions.  I also log out the other two users.  This leaves me with only 
a single login and nothing but bash running.  When I run 'free' it 
usually shows over 2 GB in use!  When I reboot, the memory usage is back 
down at about 250 MB.  Much more reasonable.

So how do I tell what is using up the memory and not freeing it up? Is 
there a way to free that memory without having to reboot?

Marc

[toc] | [next] | [standalone]


#159044

FromThe Wanderer <wanderer@fastmail.fm>
Date2015-10-13 16:40 +0200
Message-ID<qj8Ub-Wq-39@gated-at.bofh.it>
In reply to#159042

[Multipart message — attachments visible in raw view] — view raw

On 2015-10-13 at 10:26, Marc Shapiro wrote:

> Is there a way to determine what is using up my memory?  I have an
> 8GB system and every few days the memory usage rises to over 7 GB and
> up to a GB, or more of swap is used.  Granted, I have 3 X sessions
> running, along with 2 instances of Firefox and one of Chrome, not to
> mention up to 3 instances of Libre Office, but... When I first added
> the 8 GB (I used to do this on 2.25 GB!) I could run for months
> without having a memory problem.  Now it's every few days.
> 
> When this happens, I exit all programs and shut down all three X 
> sessions.  I also log out the other two users.  This leaves me with
> only a single login and nothing but bash running.  When I run 'free'
> it usually shows over 2 GB in use!  When I reboot, the memory usage
> is back down at about 250 MB.  Much more reasonable.
> 
> So how do I tell what is using up the memory and not freeing it up?

My usual first stop is top. Launch it, then press 'M' (capitalized) to
sort by memory usage; that will tell you what process(es) is(/are) using
up the largest share(s) of the RAM.

What the next steps are depends on what those processes are. In my case,
with the last significant memory leak I found, the process was X, and
further digging revealed that the X heap size was growing without limit;
it turned out to be a problem with fglrx, and went away when I switched
to the radeon drivers.

In your case, since it apparently happens without X running, the only
candidates I can think of are background (daemon-like) processes or the
kernel itself.

> Is there a way to free that memory without having to reboot?

Depends what process(es) is/are using it.

If it's a background daemon, restart that daemon.

If it's the kernel, probably not, but it would be worth reporting the
problem as a bug against the kernel.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

[toc] | [prev] | [next] | [standalone]


#159048

FromDon Armstrong <don@debian.org>
Date2015-10-13 17:00 +0200
Message-ID<qj9dv-1jL-7@gated-at.bofh.it>
In reply to#159042
On Tue, 13 Oct 2015, Marc Shapiro wrote:
> Is there a way to determine what is using up my memory? I have an 8GB
> system and every few days the memory usage rises to over 7 GB and up
> to a GB, or more of swap is used. Granted, I have 3 X sessions
> running, along with 2 instances of Firefox and one of Chrome, not to
> mention up to 3 instances of Libre Office, but... When I first added
> the 8 GB (I used to do this on 2.25 GB!) I could run for months
> without having a memory problem. Now it's every few days.

What is the precise output of free?

Odds are a huge amount of what is in "use" is actually cached or in
buffers.

Furthermore, it's pretty normal for the OS to swap out memory pages
which aren't actively being changed to make room for more buffers and
cache.

The output of top or htop sorted by memory will also be informative.


-- 
Don Armstrong                      http://www.donarmstrong.com

Nothing is as inevitable as a mistake whose time has come.
 -- Tussman's Law

[toc] | [prev] | [next] | [standalone]


#159323

FromMarc Shapiro <marcnshap@gmail.com>
Date2015-10-17 18:10 +0200
Message-ID<qkCds-2rT-29@gated-at.bofh.it>
In reply to#159048
On 10/13/2015 07:32 AM, The Wanderer wrote:
> On 2015-10-13 at 10:26, Marc Shapiro wrote:
>
>> Is there a way to determine what is using up my memory?  I have an
>> 8GB system and every few days the memory usage rises to over 7 GB and
>> up to a GB, or more of swap is used.  Granted, I have 3 X sessions
>> running, along with 2 instances of Firefox and one of Chrome, not to
>> mention up to 3 instances of Libre Office, but... When I first added
>> the 8 GB (I used to do this on 2.25 GB!) I could run for months
>> without having a memory problem.  Now it's every few days.
>>
>> When this happens, I exit all programs and shut down all three X
>> sessions.  I also log out the other two users.  This leaves me with
>> only a single login and nothing but bash running.  When I run 'free'
>> it usually shows over 2 GB in use!  When I reboot, the memory usage
>> is back down at about 250 MB.  Much more reasonable.
>>
>> So how do I tell what is using up the memory and not freeing it up?
> My usual first stop is top. Launch it, then press 'M' (capitalized) to
> sort by memory usage; that will tell you what process(es) is(/are) using
> up the largest share(s) of the RAM.
>
> What the next steps are depends on what those processes are. In my case,
> with the last significant memory leak I found, the process was X, and
> further digging revealed that the X heap size was growing without limit;
> it turned out to be a problem with fglrx, and went away when I switched
> to the radeon drivers.
>
> In your case, since it apparently happens without X running, the only
> candidates I can think of are background (daemon-like) processes or the
> kernel itself.
>
>> Is there a way to free that memory without having to reboot?
> Depends what process(es) is/are using it.
>
> If it's a background daemon, restart that daemon.
>
> If it's the kernel, probably not, but it would be worth reporting the
> problem as a bug against the kernel.
>
On 10/13/2015 07:51 AM, Don Armstrong wrote:
> What is the precise output of free? Odds are a huge amount of what is 
> in "use" is actually cached or in buffers. Furthermore, it's pretty 
> normal for the OS to swap out memory pages which aren't actively being 
> changed to make room for more buffers and cache. The output of top or 
> htop sorted by memory will also be informative. 

Well,  it was doing it again this morning after I had done a restart 
just yesterday.  Conveniently, free and top were the first things that I 
ran.  The output of free and the relevant line from top is below.  It's 
fFrefox.  Usually, it is my wife's instance of Firefox, as she keeps 
about thirty open tabs, or it is my daughters instance of Chrome.  This 
time it was my Firefox and I believe that was the case the last time, as 
well.  I don't keep a lot of open tabs.  At the moment, I have ten tabs 
open, including pinned tabs.  I am beginning to think that it is Kahn 
Academy (which accounts for four of those ten tabs open on different 
courses) which is causing the problem.  Simply closing down all browsers 
and restarting them gets back a lot of the memory (several GB at 
least).  It's just getting that last one to two GB that I have to reboot 
for.

When I do have to do a reboot I close down everything to a single 
console running.  I then run top and it only shows bash and top. Next 
time I will run top and include root and daemon processes and see if 
anything shows up.  I am guessing that this is memory that Firefox was 
using, but has forgotten about.  If that is the case, is there a way to 
free it up without doing a reboot?


:~$ free
              total       used       free     shared    buffers cached
Mem:       8176892    8072660     104232          0       1588 454736
-/+ buffers/cache:    7616336     560556
Swap:      8388604    1566652    6821952


~$ top

top - 08:22:28 up 17:42,  4 users,  load average: 7.71, 3.31, 1.74
Tasks: 298 total,   1 running, 295 sleeping,   0 stopped,   2 zombie
%Cpu(s): 14.5 us,  1.8 sy,  0.0 ni, 82.1 id,  1.5 wa,  0.0 hi,  0.0 si,  
0.0 st
KiB Mem:   8176892 total,  8071388 used,   105504 free,     3480 buffers
KiB Swap:  8388604 total,  3260756 used,  5127848 free,   466560 cached

   PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+ COMMAND
  5062 marc      20   0 7622m 5.3g  12m D   1.6 68.1 210:02.01 firefox

[toc] | [prev] | [next] | [standalone]


#159408

FromDon Armstrong <don@debian.org>
Date2015-10-18 22:00 +0200
Message-ID<ql2hA-6M1-11@gated-at.bofh.it>
In reply to#159323
On Sat, 17 Oct 2015, Marc Shapiro wrote:
> When I do have to do a reboot I close down everything to a single
> console running. I then run top and it only shows bash and top. Next
> time I will run top and include root and daemon processes and see if
> anything shows up. I am guessing that this is memory that Firefox was
> using, but has forgotten about. If that is the case, is there a way to
> free it up without doing a reboot?
[...]
>  5062 marc      20   0 7622m 5.3g  12m D   1.6 68.1 210:02.01 firefox


First off, firefox isn't something that Debian distributes. So odds are
that whatever version you're using is old and outdated, or you're using
a plugin or add-on which is buggy.

Secondly, in firefox or iceweasel, about:memory will show you want it is
doing and where it is spending its memory.

Finally, if you kill off the firefox process, it will stop using the
memory, and the memory will become free again without you doing
anything else.


-- 
Don Armstrong                      http://www.donarmstrong.com

[toc] | [prev] | [next] | [standalone]


#159556

FromMarc Shapiro <marcnshap@gmail.com>
Date2015-10-21 07:00 +0200
Message-ID<qlTFg-TD-5@gated-at.bofh.it>
In reply to#159408
On 10/18/2015 12:53 PM, Don Armstrong wrote:
> On Sat, 17 Oct 2015, Marc Shapiro wrote:
>> When I do have to do a reboot I close down everything to a single
>> console running. I then run top and it only shows bash and top. Next
>> time I will run top and include root and daemon processes and see if
>> anything shows up. I am guessing that this is memory that Firefox was
>> using, but has forgotten about. If that is the case, is there a way to
>> free it up without doing a reboot?
> [...]
>>   5062 marc      20   0 7622m 5.3g  12m D   1.6 68.1 210:02.01 firefox
>
> First off, firefox isn't something that Debian distributes. So odds are
> that whatever version you're using is old and outdated, or you're using
> a plugin or add-on which is buggy.
No, it's current.  I get it directly from the Mozilla site whenever 
there is a new release.  I am currently running 40.0.2.
> Secondly, in firefox or iceweasel, about:memory will show you want it is
> doing and where it is spending its memory.
>
> Finally, if you kill off the firefox process, it will stop using the
> memory, and the memory will become free again without you doing
> anything else.
>
>
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

[toc] | [prev] | [next] | [standalone]


#159557

FromJörg-Volker Peetz <jvpeetz@web.de>
Date2015-10-21 08:40 +0200
Message-ID<qlVe1-3hD-9@gated-at.bofh.it>
In reply to#159556
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.
-- 
Regards,
jvp.

[toc] | [prev] | [next] | [standalone]


#159641 — Re: Tracking down memory leaks (SOLVED)

FromMarc Shapiro <marcnshap@gmail.com>
Date2015-10-22 16:30 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmp2r-56v-41@gated-at.bofh.it>
In reply to#159557
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).

Marc

[toc] | [prev] | [next] | [standalone]


#159643 — Re: Tracking down memory leaks (SOLVED)

FromNicolas George <george@nsup.org>
Date2015-10-22 16:40 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmpc6-5kr-15@gated-at.bofh.it>
In reply to#159641

[Multipart message — attachments visible in raw view] — view raw

Le primidi 1er brumaire, an CCXXIV, Marc Shapiro a écrit :
> 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.

I hope you realize this is only useful for debugging purposes.

The memory used by the cache and buffers is already free, or more precisely
immediately available for applications that need it. By flushing the caches,
you just prevent the system from making use of it while nobody else does,
and therefore reduce the performances.

Regards,

-- 
  Nicolas George

[toc] | [prev] | [next] | [standalone]


#159692 — Re: Tracking down memory leaks (SOLVED)

FromCindy-Sue Causey <butterflybytes@gmail.com>
Date2015-10-23 19:30 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmOka-84O-21@gated-at.bofh.it>
In reply to#159643
On 10/22/15, Nicolas George <george@nsup.org> wrote:
> Le primidi 1er brumaire, an CCXXIV, Marc Shapiro a écrit :
>> 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.
>
> I hope you realize this is only useful for debugging purposes.
>
> The memory used by the cache and buffers is already free, or more precisely
> immediately available for applications that need it. By flushing the
> caches,
> you just prevent the system from making use of it while nobody else does,
> and therefore reduce the performances.


Your statement.... left me confused so I just bypassed it (but kept it
and Tomas' in mind). Five seconds later I entered that full command
into a search engine. For others likewise confused but less bold about
speaking up, this is one of the article/inquiry titles the search
engine pulled up:

"How do I clean or disable the memory cache?"

Ahhhh... The potential to (accidentally, even) *disable*.. That's what
the two responses must mean in this "solved" thread. Definitely not
what I personally would be wanting to do with anything memory related.
Thank you *SO MUCH* for highlighting that particular potential
outcome.

That's a BIGGIE. In fact it comes to mind to very unhumbly suggest
that some of us keep a mental tickle file on it as one checkpoint to
ask users with (computer) memory issues. Just make sure they didn't
accidentally *disable* something while following [destructions] out on
the Internet.

PS The 30 browser tabs open.. I wish! This thread has been of interest
because I'm facing needing a way to cleanse memory out without
rebooting**. The no-brainer in my case is "a few" tabs too many opened
in Iceweasel. I've been "cleansing" those out the last couple days..
That project's moving right along. The count's currently down to..

4 open windows with ~350 tabs open between them on 1GB memory. Again. lol =)

Cindy :)

** I'm trying to mentally work through a BAD #1 critical Debian bug
without rebooting. Rebooting means losing, breaking the virtual train
of thought to this point this second. For people in my cognitive
(disability type) Shoes, it represents a major loss. It's why we get
stubborn about things like not rebooting sometimes. :)

-- 
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with duct tape *

[toc] | [prev] | [next] | [standalone]


#159693 — Re: Tracking down memory leaks (SOLVED)

FromNicolas George <george@nsup.org>
Date2015-10-23 19:40 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmOtQ-8gq-11@gated-at.bofh.it>
In reply to#159692

[Multipart message — attachments visible in raw view] — view raw

Le duodi 2 brumaire, an CCXXIV, Cindy-Sue Causey a écrit :
> Your statement.... left me confused so I just bypassed it (but kept it
> and Tomas' in mind). Five seconds later I entered that full command
> into a search engine. For others likewise confused but less bold about
> speaking up, this is one of the article/inquiry titles the search
> engine pulled up:
> 
> "How do I clean or disable the memory cache?"
<snip>

I have no idea if you are saying that you understood the problem, or rather
that there is no problem, of the other way around. Maybe try to be a little
more to the point when writing your messages?

I found this page which seems to summary the point rather well:

http://www.linuxatemyram.com/

I suggest everyone who read this thread and was not already perfectly clear
on this notions peruse it, it is quite short.

Regards,

-- 
  Nicolas George

[toc] | [prev] | [next] | [standalone]


#159694 — Re: Tracking down memory leaks (SOLVED)

FromLisi Reisz <lisi.reisz@gmail.com>
Date2015-10-23 20:10 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmOWT-DI-45@gated-at.bofh.it>
In reply to#159692
On Friday 23 October 2015 18:20:10 Cindy-Sue Causey wrote:
> For people in my cognitive
> (disability type)
[earlier]
> 4 open windows with ~350 tabs open between them on 1GB memory. Again. lol
> =)

You claim to have cognitive disability, yet you can keep track of ~350 tabs???  
I can't _see_ ~350 tabs, let alone keep track of them. :-(

Lisi

[toc] | [prev] | [next] | [standalone]


#159697 — Re: Tracking down memory leaks (SOLVED)

FromThe Wanderer <wanderer@fastmail.fm>
Date2015-10-23 20:40 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmPpT-1c8-13@gated-at.bofh.it>
In reply to#159694

[Multipart message — attachments visible in raw view] — view raw

On 2015-10-23 at 14:06, Lisi Reisz wrote:

> On Friday 23 October 2015 18:20:10 Cindy-Sue Causey wrote:
> 
>> For people in my cognitive (disability type)
> 
> [earlier]
> 
>> 4 open windows with ~350 tabs open between them on 1GB memory.
>> Again. lol =)
> 
> You claim to have cognitive disability, yet you can keep track of
> ~350 tabs??? I can't _see_ ~350 tabs, let alone keep track of them.
> :-(

On my end, I have well over 4000 open tabs in Firefox (the vast majority
of them unloaded), split across seven browser windows. For the most
part, I only work with the newest / oldest set in any given window at
any given time; with tabMinWidth (or its modern equivalent) set to zero,
that comes out to ~70 tabs per window at most (and only two windows get
that high).

I've been pushing hard to reduce the number, having hit a high-water
mark of 5,190 some months ago. Some of that reduction involves moving
things to bookmarks (although not everything in those tabs is suited to
being tracked as a bookmark), and some involves getting the project /
activity which led me to open that tab to the point where the tab is no
longer necessary.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

[toc] | [prev] | [next] | [standalone]


#159696 — Re: Tracking down memory leaks (SOLVED)

FromReco <recoverym4n@gmail.com>
Date2015-10-23 20:20 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmP6A-Po-39@gated-at.bofh.it>
In reply to#159692
	Hi.

On Fri, 23 Oct 2015 13:20:10 -0400
Cindy-Sue Causey <butterflybytes@gmail.com> wrote:

> 4 open windows with ~350 tabs open between them on 1GB memory. Again. lol =)

It's possible with iceweasel/firefox. The trick is that firefox
'cheats' and does not load inactive tabs.
So, open some tabs, close Firefox. Rinse and repeat.

Why someone would use this feature instead of proper bookmarks is
something that I could never understand.

Reco

[toc] | [prev] | [next] | [standalone]


#159699 — Browser tabs, was Re: Tracking down memory leaks

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2015-10-23 21:00 +0200
SubjectBrowser tabs, was Re: Tracking down memory leaks
Message-ID<qmPJh-1zw-33@gated-at.bofh.it>
In reply to#159696
Quoting Reco (recoverym4n@gmail.com):
> 	Hi.
> 
> On Fri, 23 Oct 2015 13:20:10 -0400
> Cindy-Sue Causey <butterflybytes@gmail.com> wrote:
> 
> > 4 open windows with ~350 tabs open between them on 1GB memory. Again. lol =)
> 
> It's possible with iceweasel/firefox. The trick is that firefox
> 'cheats' and does not load inactive tabs.
> So, open some tabs, close Firefox. Rinse and repeat.
> 
> Why someone would use this feature instead of proper bookmarks is
> something that I could never understand.

I habitually use OpenInNewTab rather than the basic click, so I have a
large number of tabs, each of which has a very short history (often
zero, ie the Back button isx greyed out).

The problem with using the history in each tab (ie using the Back and
Forward buttons) is that if you go back a few pages and then click
onto a new page, you instantly lose access to all those pages that
were reachable with the Forward button.

This would be less important if the "main history" page (the
ShowAllHistory screen that might also manage your bookmarks), had a
threaded view, showing you how you reached each page. I can only find
alphabetical sorting, apart from the default order of Last Visit.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#159644

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2015-10-22 17:30 +0200
Message-ID<qmpYu-6uH-9@gated-at.bofh.it>
In reply to#159641
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?

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#159716

FromMarc Shapiro <marcnshap@gmail.com>
Date2015-10-24 08:30 +0200
Message-ID<qn0v0-vJ-3@gated-at.bofh.it>
In reply to#159644
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

[toc] | [prev] | [next] | [standalone]


#159660 — Re: Tracking down memory leaks (SOLVED)

From<tomas@tuxteam.de>
Date2015-10-23 09:40 +0200
SubjectRe: Tracking down memory leaks (SOLVED)
Message-ID<qmF7b-351-1@gated-at.bofh.it>
In reply to#159641
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Oct 22, 2015 at 07:26:14AM -0700, Marc Shapiro wrote:

[...]

> Don Armstrong had also suggested checking the cache and buffers,
> which I had forgotten to do when I restarted [...]

To quote an old Linux saw (which just paraphrases many things others
have already said in this thread):

  "if your OS isn't making use of the memory you gave it, it's
   doing a bad job"

or shorter:

  "free memory is wasted memory"

:-)

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlYp2mcACgkQBcgs9XrR2kZqiwCfZBTUG0nWn93lmG4yL9nYkLX1
dMUAnjLsIRfpc3QX8mNVIIFt1Pip00hB
=FVHn
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#159613

FromMichael Jones <mj@mikejonesey.co.uk>
Date2015-10-21 23:40 +0200
Message-ID<qm9h0-6Z6-15@gated-at.bofh.it>
In reply to#159408
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 18/10/15 20:53, Don Armstrong wrote:
> a plugin or add-on which is buggy

I second that.

I have this issue with a bug in a thunderbird plugin, goes crazy and
eats the memory.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWKARTAAoJEOYwtpHNe8Fm4I8H/06fcgDNGz43KYBjVP5bmYc5
6TpWjCkQAWly+VyaxLaUrmZj9Z7p/Ird5tN1ISudxF8PoECrfJe/lHXa6xUzVlAo
lAGyQ6bEaqXrOHcRUdhm93IzOQ/EIyOBEc2GQRZ+rC8+gBAPc62qhWthe5SKy+13
a5En8y91yAJKfGrY0B5E3UByxLwBPDIXo58FwlXZHgGIsd2dPsvOiWmfh+mcHQSg
D1HC9Exxd0UV02k9tZ6oFRYBMLsyqh8jeCVLITEuFI7tFzREX2STRWBKAviMvd1z
1+2LdwBHSmsIun5HP3TILxEzc+Kw7sbowqbz0FQajn1iDv3taWvL/xYqZ2y6TuY=
=at6L
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#159612

FromMichael Jones <mj@mikejonesey.co.uk>
Date2015-10-21 23:30 +0200
Message-ID<qm97j-6NL-19@gated-at.bofh.it>
In reply to#159042
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 13/10/15 15:26, Marc Shapiro wrote:
> So how do I tell what is using up the memory and not freeing it up?
> Is there a way to free that memory without having to reboot?

ps -eo pid --sort rss | tail -1 | xargs sudo strace -fp

would show what the application with the most ram is doing but you'd
ideally want to filter the trace for certain calls.

for a solution not so advanced / technical:

ps -eo pid,rss,cmd --sort rss | tail

this will show the process with the most reserved memory at the
bottom, along with listing the process name.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWKALPAAoJEOYwtpHNe8Fmov4H/j/YoEO3Y4M+HsqWes2qKd1I
tRgB5nQS2c6wF+m3+uGUOoSfPQxPjIJnYcz48uP4dJzXPJWzLTDuIB59tZU8DoH0
94O3ruDEqrlxtzMzAFTtV1wCLO6KAGmFl2K/WL5NGoQsJ3ftaJIwC8YYoG88cKBx
st6b03lgTLB//WFyfpAgg2M2lJ87iC9/GhI5r/nOvaE1NCeMyFVBI2RFEDc7UoGz
H28UPlPJBuFMkZKv7wy/3a/tEx0UeT883PhTDe7wSRoPdrTDYsgsA9UtNjz4jeJF
cc5Z4NmwAxoahhXWiOv/uUrCeaSHjKyiPdDCzVO4j7YgeIVNb2NSWMpG5dj05tc=
=yKXL
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.debian.user


csiph-web