-
Notifications
You must be signed in to change notification settings - Fork 162
memory consumption and cache not releasing memory #177
Comments
Memory managment could definitley be improved. Emacs has it's own additional image cache, which isn't touched by |
Many thanks for the super quick reply - you're a star! I haven't thought of emacs having its own cache, so despaired at trying to make pdf-tools release memory. But your tipp fixed the issue well enough for now. I reduced image-cache-eviction-delay to 5 seconds.Emacs now still uses some 400 MB in total, way more than I'd expect for just storing images for 2 rendered pages (I reduced the limit to that), but then does not keep growing, and at times also releases memory back, e.g. a bit after (way more than 5 seconds) I kill the pdf-view buffer. I'm very glad I can keep using my nice setup for pdf reading! |
Each displayed page uses about .5 MB, which adds up. |
Couldn't we use Also it would probably be a good idea to call |
Flushing the image after removal from the cache sounds good. The other functions you mentioned don't use this cache and they may produce many images. So, I'm thinking of calling |
For |
I have similar problem with emacs not releasing memory after opening several pdfs. The memory is not released even after closing the pdf buffers. The graph was generated with the following config
Not sure if the problem is with pdf-tools or with emacs itself. |
Have you read #177 (comment) ? |
Yes, I have tried the suggestion from the comment. My example has |
How did you measure memory consumption ?
|
Hmm. I actually observe similar problem when just opening a bunch of images. Not just with pdfs. |
might this one be related: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37006 ? In any case, the bug report referenced by @yantar92 seems to fixed now (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38345) (in version 28.1) |
i find this issue pretty frustrating when i zoom any pdf files. a little hack to release some memory on closing: run
found in the emacs-dev list linked above. |
no they just closed the bug report because they found it to not be a memory leakage but the fact the memory allocator does not returns memory to the OS, and there wasn't follow up in fixing it. I'm still experiencing this issue in 28.1. I know this repo is not updated anymore, but just wanted to leave this here for anyone who is going to read it in the future.
|
I've happily used pdf-view on a relatively high-memory and low-resolution machine so far, but now that I've switched to a lower-memory, high-resolution (3k) machine, I notice that pdf-view hogs huge amounts of memory and that the cache clearing mechanism does not seem to work. For example, 100 page simple B&W pdf document easily makes emacs use 500MB of memory.
Closing the file does not release that memory, and reducing pdf-cache-image-limit has no effect on memory consumption. The cache limit does have an effect on scrolling speed, as pages have to get rendered again if I go over the page limit, but memory consumption keeps increasing with every new page scrolled to even when the limit has already been exceeded. Likewise, the defuns for clearing the cache don't seem to take effect - I wrapped pdf-cache-clear-images in an interactive defun and call it from the buffer in which the file is opened - no luck.
I'm using emacs 24.5.1 64bit on debian unstable in a virtual machine on a Surface Pro 4. Poppler version is 0.38, I think. Can anyone reproduce this problem?
The text was updated successfully, but these errors were encountered: