Open emwal opened 1 year ago
Yeah, i too have faced high memory usage, there is M-x pdf-cache-clear-data
too.
I ended up making a function and i use it everywhere mapped to Q
, in most of the reading buffers.
(defun d/kill-buffer ()
"Clear the image cache (to release memory) after killing a pdf buffer."
(interactive)
(if (one-window-p) (kill-this-buffer)
(kill-buffer-and-window))
(clear-image-cache)
(pdf-cache-clear-data))
Hope that helps!
It seems like, pdf-tools fails to call
clear-image-cache
when the active buffer is closed.
Image cache is managed by Emacs and is cleared automatically. If you want to do it more aggressively, you can set a lower value for image-cache-eviction-delay
.
Problem: Opening and reading pdfs sequentially fills up system memory.
Steps to reproduce:
M-x memory-report
shows big "total image cache size"Fix: Eval
(clear-image-cache)
and the memory should return to normal.It seems like, pdf-tools fails to call
clear-image-cache
when the active buffer is closed.(Doom-)Emacs 28.2 pdf-tools installed via straight.el, commit "bc2ba117e8c3196ff9adf0da4fa1e63a8da3d7c8"