From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56546: 29.0.50; unbounded RAM comsumption when displaying images Date: Thu, 14 Jul 2022 09:04:51 +0300 Message-ID: <83zghctekc.fsf@gnu.org> References: <87cze84gst.fsf@mail.jao.io> <8335f4uu17.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29064"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56546@debbugs.gnu.org To: mail@jao.io Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 14 08:06:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oBrzQ-0007Ox-Jt for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jul 2022 08:06:20 +0200 Original-Received: from localhost ([::1]:52446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBrzP-0001a8-7t for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jul 2022 02:06:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBrz8-0001Zn-Tz for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 02:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBrz8-0001r2-Kk for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 02:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oBrz8-0005GM-G8 for bug-gnu-emacs@gnu.org; Thu, 14 Jul 2022 02:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jul 2022 06:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56546 X-GNU-PR-Package: emacs Original-Received: via spool by 56546-submit@debbugs.gnu.org id=B56546.165777870820159 (code B ref 56546); Thu, 14 Jul 2022 06:06:02 +0000 Original-Received: (at 56546) by debbugs.gnu.org; 14 Jul 2022 06:05:08 +0000 Original-Received: from localhost ([127.0.0.1]:48429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBryF-0005F5-Vt for submit@debbugs.gnu.org; Thu, 14 Jul 2022 02:05:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBryD-0005EV-Eo for 56546@debbugs.gnu.org; Thu, 14 Jul 2022 02:05:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38162) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBry8-0001ZE-0j; Thu, 14 Jul 2022 02:05:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=m/D1DuDlecg4w/nxgQ+S8K/hcjCURKT6oLe4aX/ah7A=; b=pbJJmIPMySYC 0Y/Bpx8QAeW25OnWPi6TiKgnCmP2AGAF1eQt23zU5wGRmzg6ao0T54zVCrivL4WjpTzm339HIIItn 83fWKItTWqUaozfy8eG08Nescnl7nnJkd1BzCxkcdqc14YguLhbSjNkRGNhfNSsyPmYQFtbUbwZi6 Pmb2QwOPXV2q6KN3Ic/PwO6XmZlciTHJ0xJFiONm7f15WN7/o0mLI9FtIJ64wima916MavqbwQN5M uAGv8vZRsGfBo76MJKTY1g2di2L+jXfMBrn4CRbdIWZJRV+3nFzXiPDdOqH2gHK9ieSFfLA7JTwU5 b9DuS/vwzHMVecOttltdRg==; Original-Received: from [87.69.77.57] (port=1740 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBry6-0007gL-Vi; Thu, 14 Jul 2022 02:04:59 -0400 In-Reply-To: <8335f4uu17.fsf@gnu.org> (message from Eli Zaretskii on Thu, 14 Jul 2022 08:45:24 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236954 Archived-At: > Cc: 56546@debbugs.gnu.org > Date: Thu, 14 Jul 2022 08:45:24 +0300 > From: Eli Zaretskii > > > From: "Jose A. Ortega Ruiz" > > Date: Thu, 14 Jul 2022 02:35:46 +0100 > > > > > > It seems to be easy to make emacs (under X) to consume more and more > > RAM, which is never released, by making it display images. A extreme > > (in my experience) case is animated GIFs, try: > > > > - emacs -Q > > - M-x eww RET https://xenodium.com/emacs-zones-to-lift-you-up/ > > - RAM consumption grows to ~600Mb > > - R (redisplay page): RAM grows to ~1100Mb > > - R (redisplay page): RAM grows to ~1752Mb > > - R (redisplay page): RAM grows to ~2222Mb > > - rinse and repeat: RAM never goes down > > - (image-cache-size) reports a modest 82Mb > > - Kill buffer: high RAM consumption is still at its maximum, even > > after (image-cache-size) goes to 0 > > Run some utility that displays the memory-map of an application, and > you will see that most of that memory is free for use. Emacs just > didn't release it to the OS, but kept it in the memory pages allocated > to the process, for future allocations. > > The strategy for releasing memory to the OS is in glibc, not under our > control. Last time we talked with glibc developers, they maintained > that this is the expected and correct behavior. Btw, did you try M-: (clear-image-cache) RET followed by "M-x garbage-collect RET"?