[Top][All Lists]

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

Re: Memory again

From: Tim Connors
Subject: Re: Memory again
Date: Thu, 15 Dec 2011 14:52:23 +1100 (EST)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Tue, 6 Dec 2011, Stefan Monnier wrote:

> > I'm writing this message on that very same emacs process. Right now it
> > has 60 buffers, all of them with a size below 50KB and most below
> > 10KB. As reported by `htop', the process is using 533MB of RES memory
> > and 630MB of VIRT memory.
> Nothing of what you say sounds worrisome: apparently you now have around
> half a GB of memory allocated for use by Lisp data.  Most likely the
> majority of it is considered by Emacs as "free for reuse", but it's not
> returned to the OS because that is only done in "big chunks" (typically
> 10KB or so) and none of the big chunks are 100% free (they all contain
> at least one non-free object).
> Some of that memory may also belong to malloc rather than to Emacs:
> Emacs did pass it to `free', but the malloc library decided that it's
> not worth returning those elements to the OS.
> Of course, it may also be that we have an actual leak (i.e. some of that
> memory was neither returned to malloc, nor is it still managed by
> Emacs).  But as long as you don't have evidence of a leak, I'd suggest
> you move on, because there's really not much we can do about the above
> problem (short of rewriting the whole memory management to make it
> compacting).

I recently switched over to Emacs, from XEmacs, porting my .config files
over as necessary.  I am used to being able to run XEmacs for months on
end, with XEmacs's gnuclient, and having hundreds of buffers and dozens of
frames open.  The XEmacs process would sometimes take 100M or so resident,
and if I opened a big file and tried to fontify it, then naturally usage
would increase.  Some of this would be returned to the OS, some of it
wouldn't, when I closed buffers.  I lived with that because I didn't tend
to stupidly open big files and fontify them too often.

But right now, having had emacs up for a few days, and only opening 10
small files with the aid of emacsclient, emacs's RSS is 130M.  It had
climbed up to 400M before I most recently killed it.

What's the differences between emacs's and xemacs's allocators?

By the way, the dismissal of this being a real problem because emacs can
always reuse the fragmented memory either

1) ignores the fact that computers are general purpose and can run other
programs simultaneously (some of them being rather high quality bloatware
like mozilla), or

2) takes the view that emacs is an entire operating system, and there's no
need to run anything else, a little too seriously

Tim Connors

reply via email to

[Prev in Thread] Current Thread [Next in Thread]