From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Re: Question about (excessive?) ram usage when many overlays (with large vscroll) Date: Wed, 27 Apr 2022 16:01:59 +0200 Message-ID: References: <87levs2enb.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006c595605dda34190" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12917"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 27 16:02:57 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njiFs-0003DP-QP for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Apr 2022 16:02:56 +0200 Original-Received: from localhost ([::1]:38220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njiFr-00007U-Ed for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Apr 2022 10:02:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njiFB-0007rQ-Ml for emacs-devel@gnu.org; Wed, 27 Apr 2022 10:02:13 -0400 Original-Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]:44954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njiF9-0003gf-SG for emacs-devel@gnu.org; Wed, 27 Apr 2022 10:02:13 -0400 Original-Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-2f7d621d1caso19510467b3.11 for ; Wed, 27 Apr 2022 07:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o9vqeJd5ICPnMP/n+aqaELt/gs+EoDoE75Q+Z38rNVY=; b=jgsMEvhWqtpUsUxkqB7QxGppOOug2wmHmIeWRpps0k7+EQp4ioYjOooo6F7GrXW074 8yCGAbJgGFE8YMgzmGiFXZM0O4v6tOHsujt+cNvozTdNRsKB2NJkJxMwZMOfHlajo0eL ReDcz23VKrfdZMFPXpUNeyEgWa8o1AuyLlT2QPMVjn5glJJ5Kp9OJHSabEXiyVQKfrTe FDRM5oE9ysq4sS153AWUPKY6y+N3dHuTjFlyG7BqYUp+uNLAHFnmtQWoikO7CytlvnvZ 1oj1ZwzRfit2+EiecM07BY+YgiinYOtbN2DMfI+tNPzGl06OtzqLytYVnJuRZsCEhZpo mv3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o9vqeJd5ICPnMP/n+aqaELt/gs+EoDoE75Q+Z38rNVY=; b=JpUjSXIasIYwO5q4CH/GwqIhMQ3PyKqHEdgsknMmvLIO5xtw1yPf7bCekzMlyJB+Xh ymekUqztTZPlZpm8j2LMTxAoUwsjI1duZzZlCge5ddF/IAfxx+2fbot0bnAbX5DKeoUd Gq2uS5s64DZtacGfznkVC0WYrU10fNkU9Xk74eMOMdzZf1XWoDT0TPFrwWrO4+/IK7RX iHS2TModbfOhFakPrfp1gwm9NPuxAJzTJSbn7MwS3lLhFHcnZI2F7RkP/ycxS4f//hLg A7zhNeWAWpNKB3ehAK+x+ZVIp75IgXxc6EPJ64fR0llg6mljBe+Ql5VYsaWQvbFoJ0vv 6Ujw== X-Gm-Message-State: AOAM5337Zhsp1npDHA0Kj8xY3vzQwewwoUkafZ0PHHs+1mVj6vRkVH/C +5bfggjW/ArZEY+CrDlUXaYWY77W2u/+Ms6kN1I= X-Google-Smtp-Source: ABdhPJxr1bKZksGVk06OW7hmAcRquB51YlngPGNEz6iVqnhzfqwWMNmxPZM+S9n2a4NDv00tc/FxwxuDQWV0sFzFOrc= X-Received: by 2002:a81:6d0c:0:b0:2f8:1ba3:64f8 with SMTP id i12-20020a816d0c000000b002f81ba364f8mr10353720ywc.228.1651068130579; Wed, 27 Apr 2022 07:02:10 -0700 (PDT) In-Reply-To: <87levs2enb.fsf@yahoo.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::1135; envelope-from=dalanicolai@gmail.com; helo=mail-yw1-x1135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288918 Archived-At: --0000000000006c595605dda34190 Content-Type: text/plain; charset="UTF-8" Thanks Po! Indeed, I was not aware of that (I couldn't find anywhere what vscroll means 'exactly', i.e. I did not know it was 'relative w.r.t. the 'current point'). Anyway, indeed doing what you suggested works great (i.e. fast scrolling and no issue with the large memory). Too bad I have to rewrite substantial parts of image-roll.el again, but after that I think it will finally provide a quite nice 'image-roll'. On Tue, 26 Apr 2022 at 14:49, Po Lu wrote: > dalanicolai 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. > --0000000000006c595605dda34190 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Po! Indeed, I was not aware of that (I couldn&= #39;t find anywhere what vscroll means 'exactly',
i.e. I = did not know it was 'relative w.r.t. the 'current point').
Anyway, indeed doing what you suggested works great (i.e. fast scroll= ing and no issue with the
large memory). Too bad I have to rewrit= e substantial parts of image-roll.el again, but after that I
thin= k it will finally provide a quite nice 'image-roll'.

On Tu= e, 26 Apr 2022 at 14:49, Po Lu <lu= angruo@yahoo.com> wrote:
dalanicolai <dalanicolai@gmail.com> writes:

> So I have created `image-roll.el` for displaying documents/books (see<= br> > here).=C2=A0 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<= br> vscroll large amounts of text.=C2=A0 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.
--0000000000006c595605dda34190--