From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33275: 27.0.50; Image cache pruning Date: Mon, 05 Nov 2018 20:18:17 +0200 Message-ID: <83lg67crrq.fsf@gnu.org> References: <83va5bcxxu.fsf@gnu.org> <83sh0fcx2r.fsf@gnu.org> <83o9b3cu4f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541442792 3417 195.159.176.226 (5 Nov 2018 18:33:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2018 18:33:12 +0000 (UTC) Cc: 33275@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 05 19:33:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJjgR-0000lV-3J for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2018 19:33:07 +0100 Original-Received: from localhost ([::1]:36978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJjiX-0001zw-IZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2018 13:35:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJjT3-0005pf-Cu for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 13:19:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJjSq-0006WT-3a for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 13:19:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJjSo-0006Vj-KT for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 13:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJjSo-0007Wj-EZ for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 13:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Nov 2018 18:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33275-submit@debbugs.gnu.org id=B33275.154144193528920 (code B ref 33275); Mon, 05 Nov 2018 18:19:02 +0000 Original-Received: (at 33275) by debbugs.gnu.org; 5 Nov 2018 18:18:55 +0000 Original-Received: from localhost ([127.0.0.1]:35577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJjSe-0007WL-6U for submit@debbugs.gnu.org; Mon, 05 Nov 2018 13:18:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJjSY-0007W7-TL for 33275@debbugs.gnu.org; Mon, 05 Nov 2018 13:18:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJjSN-0005ZX-TX for 33275@debbugs.gnu.org; Mon, 05 Nov 2018 13:18:41 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJjSK-0005X0-Ia; Mon, 05 Nov 2018 13:18:33 -0500 Original-Received: from [176.228.60.248] (port=2004 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gJjSA-0007X6-OJ; Mon, 05 Nov 2018 13:18:24 -0500 In-reply-to: (message from Lars Ingebrigtsen on Mon, 05 Nov 2018 18:36:39 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152071 Archived-At: > From: Lars Ingebrigtsen > Cc: 33275@debbugs.gnu.org > Date: Mon, 05 Nov 2018 18:36:39 +0100 > > It would be reasonable if the code had asked for those images to be kept > in memory, but it hasn't. Emacs decides that on its own without saying > that it's doing that. You cannot assume anything about memory management while a Lisp program runs. > It'd be similarly surprising if > > (dolist (file (directory-files "/directory/with/many/images" t "png$")) > (with-temp-buffer > (insert-file-contents-literally file))) > > were to lead to Emacs growing uncontrollably. That it doesn't is just sheer luck: the way we manage buffer memory is special. With any other Lisp object, it could well grow uncontrollably. Our way of keeping that in check is to signal memory-full error when we are about to run out of memory. Not sure yet why this doesn't happen in your original recipe. > > I think we should try to add some code that would call > > display_malloc_warning and/or memory_full, before the system runs out > > of memory. That should be enough to prevent OOM in such cases. Can > > you spot why we never called memory_full in this case? > > Sorry, I'm not familiar with the memory_full stuff... OK, I will try to look into this soon.