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 19:27:28 +0200 Message-ID: <83o9b3cu4f.fsf@gnu.org> References: <83va5bcxxu.fsf@gnu.org> <83sh0fcx2r.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541438839 19930 195.159.176.226 (5 Nov 2018 17:27:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2018 17:27:19 +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 18:27:14 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 1gJief-00053W-6y for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2018 18:27:13 +0100 Original-Received: from localhost ([::1]:36580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJigl-0008Qx-JN for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Nov 2018 12:29:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJigX-0008Ni-D7 for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 12:29:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJigT-0008Fx-3x for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 12:29:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJigQ-0008E8-FS for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 12:29:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJigQ-0006Lu-CF for bug-gnu-emacs@gnu.org; Mon, 05 Nov 2018 12:29: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 17:29: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.154143888124313 (code B ref 33275); Mon, 05 Nov 2018 17:29:02 +0000 Original-Received: (at 33275) by debbugs.gnu.org; 5 Nov 2018 17:28:01 +0000 Original-Received: from localhost ([127.0.0.1]:35520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJifM-0006Ju-0K for submit@debbugs.gnu.org; Mon, 05 Nov 2018 12:28:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60105) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJifH-0006Je-Bu for 33275@debbugs.gnu.org; Mon, 05 Nov 2018 12:27:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJif4-0003wA-Bt for 33275@debbugs.gnu.org; Mon, 05 Nov 2018 12:27:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJif1-0003nj-1T; Mon, 05 Nov 2018 12:27:36 -0500 Original-Received: from [176.228.60.248] (port=2737 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gJiey-0000qH-Rn; Mon, 05 Nov 2018 12:27:34 -0500 In-reply-to: (message from Lars Ingebrigtsen on Mon, 05 Nov 2018 17:35:51 +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:152065 Archived-At: > From: Lars Ingebrigtsen > Cc: 33275@debbugs.gnu.org > Date: Mon, 05 Nov 2018 17:35:51 +0100 > > >> If you visit a, say, 16GB file, then, indeed, it's expected that Emacs > >> grows to 16GB (or more). But if you're just calling `image-size' on a > >> bunch of files (each of which is a lot smaller than that), it's rather > >> unexpected that that's going to blow up Emacs. > > > > What was the sum of sizes of all the files you used to reproduce the > > problem? > > I think it's sufficient to run Emacs over 2GB worth of .png files to > make Emacs grow to 16GB (which will kill it on this laptop). > > But it'll vary on how well-compressed the .png files are, I guess, > because I think Emacs caches the, er, pixmaps and not the files? I > don't remember. I think it's reasonable to expect 2GB worth of image files to take several times that in memory. (Btw, visiting a 16GB file usually takes twice that much during insert-file-contents.) 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?