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: Ihor Radchenko
Subject: bug#38345: 27.0.50; Permanent increase in memory consumption after opening images (or pdfs)
Date: Sat, 23 Nov 2019 23:18:21 +0800

> I see no attachment here, but isn't this because Emacs never returns
> memory to the system when it frees it?

Sorry, I forgot to send the attachment in the first message. I have sent
a followup, but also attaching here just in case.

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.

Regards,
Ihor

Attachment: images2.png
Description: PNG image



Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ihor Radchenko <yantar92@gmail.com>
>> Date: Sat, 23 Nov 2019 22:37:44 +0800
>> 
>> Recently, I have noticed that my emacs tends to increase its memory
>> usage up to over 1.5Gb after I open a large number of pdf documents. It
>> is understandable since some of the pdfs can be quite large. However,
>> the problem is that the memory does not seem to be released even after I
>> close all the pdf buffers.
>> 
>> First, I though that the issue is with pdf-tools and reported my problem
>> there (https://github.com/politza/pdf-tools/issues/177). However, the
>> memory consumption problem appears to happen even if I just open images.
>> 
>> I monitored emacs (emacs -Q) memory usage with 
>> https://github.com/dkogan/memory_leak_instrumentation
>> 
>> If I open a large (>250) photos using the code below, the memory usage
>> increases permanently even after I close all the image buffers and wait
>> for some time. 
>> 
>> #+begin_src emacs-lisp
>> (setq large-file-warning-threshold nil)
>> (setq image-cache-eviction-delay 5)
>> (find-file "~/Tosort/pictures&photos/*.jpg" 'wild)
>> (mapc #'kill-buffer (seq-filter (apply-partially #'string-match ".+.jpg$") 
>> (mapcar #'buffer-name (buffer-list))))
>> (clear-image-cache t)
>> (garbage-collect)
>> #+end_src
>> 
>> The attached is memory consumption plot I got after running M-x
>> eval-buffer on the code above several times (each run correspond to the
>> memory consumption peak on the plot).
>
> I see no attachment here, but isn't this because Emacs never returns
> memory to the system when it frees it?

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong 
University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg

reply via email to

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