emacs-devel
[Top][All Lists]
Advanced

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

Re: Does Emacs return memory to the system on Mac OS X or *BSD?


From: Stefan Monnier
Subject: Re: Does Emacs return memory to the system on Mac OS X or *BSD?
Date: Wed, 10 May 2017 20:06:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> system. My recall is vague as it was a long time ago, but in essence, while
> an app can release memory it no longer requires, that memory is not
> actually released back to the OS to be used by other apps until the app has
> exited. The upshot is that while the app i.e. emacs, may have
> freed/released memory, the OS won't see that released memory until after
> emacs has exited.

Indeed.  And in practice it makes very little difference: this freed
memory, by its very nature, will not be accessed by the application, so
it will naturally end up swapped to disk if memory pressure requires it.

IOW the only difference is in the fact that it requires more swap space,
which can occasionally be noticeable, e.g. when you don't have swap
space at all.

> I can say that I use emacs intensively on both Linux and OSX and run for
> long periods of time and certainly don't notice any loss of available
> memory or Emacs growing in footprint size.

Since this "unreturned freed memory" is free and hence available for
reuse, it cannot cause excessive *growing* of a process.  It can only
cause a lack of shrinking, which is why it rarely matters.

Excessive growth ("excessive" in the sense that it eats more memory than
what is actually used) is usually caused by things like leaks or
fragmentation, which are different issues.


        Stefan



reply via email to

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