emacs-devel
[Top][All Lists]
Advanced

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

Re: Memory again


From: Eli Zaretskii
Subject: Re: Memory again
Date: Tue, 06 Dec 2011 08:07:46 -0500

> Date: Tue, 06 Dec 2011 14:24:11 +0400
> From: Dmitry Antipov <address@hidden>
> 
> On 12/06/2011 01:35 PM, Carsten Mattner wrote:
> 
> > I still believe this is what's happening for me on Linux 3.x and Darwin 
> > 10.7.x
> > when I kill a buffer and the claimed memory is not given back to the kernel.
> 
> Yes, it's very easy to reproduce. Generate the following C code:
> 
> #warning oops0
> #warning oops1
> /* a lot of */
> #warning oops999999
> main () {}
> 
> then M-x compile it, wait a lot until it's done, then kill *compilation*
> buffer and see RSS.

I don't think this extreme case is very interesting.  For that matter,
I don't think Carsten's use case is even remotely similar.

> I tried with 1M of #warnings, and (buffer-size *compilation*) was 58M - but
> RSS grows to 2250M. During compilation, strace shows an excessive usage both
> of mremap() (for buffer text, I suppose) and brk(). When I kill *compilation*,
> munmap() was issued to free buffer text. Next, I call garbage-collect:
> 
> ((63789 . 19159) (15579 . 0) (45 . 234) 160925 331403 (74 . 320) (696 . 251) 
> (6794 . 10907))
> 
> But even after GC, RSS is 2192M. Oops.

If you then re-run the same compilation again, you should see the RSS
grow by very little, not by another 2GB.  If so, then at least Emacs
reuses the memory as efficiently as it can.

But again, this use case is IMO not interesting in practice.



reply via email to

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