dalanicolai <dalanicolai@gmail.com> writes:
> So I have created `image-roll.el` for displaying documents/books (see
> here). However, I have just noticed that it uses a large amount of
> RAM when viewing (or trying to) pages in the back of 'large'
> books. But even if RAM usage still looks perfectly fine, Emacs crashes
> when trying to scroll to higher page numbers.
I didn't try to reproduce this problem, but note that it's slow to
vscroll large amounts of text. Instead, find the start of the first
line that will be visible onscreen (using window-text-pixel-size or
posn-at-point), make that the window start, and set vscroll starting
from there instead.