[Top][All Lists]

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

Re: Memory again

From: Nix
Subject: Re: Memory again
Date: Sun, 11 Dec 2011 17:49:23 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

On 6 Dec 2011, Stefan Monnier stated:

>> 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).

More generally, unless this is the *last* such chunk allocated, it's not
going to be returned to the OS (as 10Kb regions are small enough that
they're going to come from brk space on every malloc I've ever heard of,
not malloc space).

It might be worth trying to boost that 10Kb 'big' chunk to 2Mb or
something. That'll force mmap() allocation on a lot of recent Linux
systems. (Of course, if you have tens of thousands of those, you can run
into kernel limits: but if your Emacs is using that much memory, you
have bigger problems.)

NULL && (void)

reply via email to

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