[Top][All Lists]

[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 19:20:09 +0200

> From: Stefan Monnier <address@hidden>
> Date: Tue, 06 Dec 2011 08:29:06 -0500
> Cc: address@hidden
> Still, the point in any case is that if the buffer is 60MB, then killing
> it will return those 60MB to the kernel, but it won't return to the
> kernel the memory allocated for Lisp objects such as interval nodes
> (used for text-properties), cons cells, strings, etc...

??? Don't we free interval nodes that point into a buffer that is
killed?  Why would we need to keep them around?

Anyway, the theory behind this experiment is that inserting lots of
text in small chunks causes massive reallocations, one each for every
time you fill the gap, and this fragmentation of the memory, which
then makes it impossible to release more than the last 60MB.

> Emacs should be perfectly able to reuse it next time it needs memory for
> cons cells, strings, interval nodes, ...

Actually, it seems to reuse even the fragmented chunks left from
previous buffer reallocations.

> E.g. re-running the same compilation should not significantly grow the
> Emacs process (other than the extra 60MB, of course).

That's what I saw, indeed.

reply via email to

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