bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#38345: 27.0.50; Permanent increase in memory consumption after openi


From: Eli Zaretskii
Subject: bug#38345: 27.0.50; Permanent increase in memory consumption after opening images (or pdfs)
Date: Sat, 23 Nov 2019 17:45:09 +0200

> From: Ihor Radchenko <yantar92@gmail.com>
> Cc: 38345@debbugs.gnu.org
> Date: Sat, 23 Nov 2019 23:18:21 +0800
> 
> What you say about Emacs not returning memory sounds like very very
> strange behaviour unless I misunderstand something. Does it mean that if
> I have emacs running as daemon and open a few hundreds of heavy pdfs
> during, say, a week, it will keep all the memory allocated for those pdfs
> (which is several Gb, at least)? If so, I don't think that Emacs should
> do it.

It depends on how the memory is allocated.  Memory allocated for
buffers gets returned to the OS when those buffers are killed.  But
memory allocated via malloc AFAIK gets grafted into the program's
address space, and when it is freed, it is left in the program's
address space, free to be used by that program for any further
allocation -- but is not returned to the system.  So if you look at
the program's address space, you will think it only ever grows,
especially if you allocate a lot of memory before releasing the first
allocation.

At least that's what I think happens on modern platforms.





reply via email to

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