[Top][All Lists]

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

Re: Debugging emacs memory management

From: Davis Herring
Subject: Re: Debugging emacs memory management
Date: Wed, 16 Sep 2015 10:34:58 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110717 Lanikai/3.1.11

> Another observation is that the gc never really gives back the memory.
> [...]
> So the memory IS freed, but emacs never gives it back to the OS.

The Emacs GC can relocate some things (e.g., strings) to help make
memory available all the way back to the OS, but -- at least for many
small allocations -- it is typical that memory freed within a process
never makes it back to the OS.  The "small allocations" is because
modern malloc(3)s use mmap(2) to obtain large blocks of memory and those
are returned to the OS immediately upon free(3).  Otherwise the best you
can hope for is for some of Emacs' pages to be dropped to swap, where
(if that memory is never used again by Emacs) they will languish until
Emacs exits.


This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

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