[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs eats up my memory while viewing images
From: |
Danny YUE |
Subject: |
Re: Emacs eats up my memory while viewing images |
Date: |
Fri, 09 Jun 2017 00:06:49 +0800 |
User-agent: |
mu4e 0.9.18; emacs 25.2.1 |
On 2017-06-08 15:09, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Danny YUE <sheepduke@gmail.com>
>> Date: Thu, 08 Jun 2017 19:58:03 +0800
>>
>> I was viewing some (well, lots of) old images using image+ in Emacs.
>> Then I noticed that it opens new image slower and slower.
>> I ran command `free -h` and noticed that my memory was almost totally
>> consumed.
>> Then I killed Emacs and memory consumption dropped to normal level.
>>
>> I suspect there is something wrong with it, because when I press "N" for
>> `image-next-file`, the old image file is removed from buffer list, thus
>> the memory consumed by it *should* be released...
>
> The memory isn't released immediately because Emacs caches images for
> better performance. And even if Emacs does free the memory used for
> the image and its buffer, it doesn't necessarily return that memory to
> the OS; that depend on the build and the OS you are using.
>
> Try the command "M-x clear-image-cache". If that helps, you may wish
> to customize your value of image-cache-eviction-delay.
In fact `clear-image-cache` is not really an interactive command, it is
a function.
The current value of `image-cache-eviction-delay` is 300.
I will try to set it to a smaller value and have a try.
Thanks.
Danny