From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jose Antonio Ortega Ruiz Newsgroups: gmane.emacs.devel Subject: Memory problems update (was: Implementing image support for kitty terminal) Date: Thu, 22 Sep 2022 18:31:36 +0100 Message-ID: <87v8pfwc1z.fsf@mail.jao.io> References: <87v8pz18wf.fsf@mail.jao.io> <83o7vrgimc.fsf@gnu.org> <87wnafdnee.fsf@logand.com> <835yhzgdyi.fsf@gnu.org> <87k06den1s.fsf@logand.com> <87illxy5ir.fsf@mail.jao.io> <87sfl1d1wi.fsf@logand.com> <87czc5y1wp.fsf@mail.jao.io> <871qsl8gt4.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2434"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 22 21:20:31 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 1obRkM-0000Vi-CV for ged-emacs-devel@m.gmane-mx.org; Thu, 22 Sep 2022 21:20:30 +0200 Original-Received: from localhost ([::1]:41228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obRkL-0008SD-08 for ged-emacs-devel@m.gmane-mx.org; Thu, 22 Sep 2022 15:20:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obQ31-0000EQ-Sz for emacs-devel@gnu.org; Thu, 22 Sep 2022 13:31:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obQ31-0002B7-Bi; Thu, 22 Sep 2022 13:31:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=B+D5WgsGN3EdPMSgQEuDZ/j9+ao+ruT7eCaGFw7/ljk=; b=Eg0PPrUtsbkM46JP9X0Y r/HSextA8C+0qnjUqKVCfcp2Y/wkDNqoAWz6CH9RQPmjeHEj+3e8EUBC75vQYc/3F05Wm+uM0xYvK 8Vg0dmAVdMGLs68dY5MZGr1TRrqdtVaAKzT9h4FdL5GbREhw4QuOJVE/AMPATj61sHrjl3727D72s xkXBkA5vzFUaMOEniCSL3fcYw59GxsmJiYgncb/EYaUNGhnGq+Qb/LuI/j+n6nPMO3oPC5rRqV+6a b3A7YOAzsAqfpksq7S4D1PdRnNFdGNZUYc0wQGsnMSo43ZHIXbuuXcAD0tM83jeUDdKMl3bL2sfrf VnPmBntxO4OCHw==; Original-Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:55362 helo=rivendell.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obQ30-0003s9-Rj; Thu, 22 Sep 2022 13:31:38 -0400 Original-Received: from localhost (rivendell.localdomain [local]) by rivendell.localdomain (OpenSMTPD) with ESMTPA id 1c507e80; Thu, 22 Sep 2022 17:31:36 +0000 (UTC) In-Reply-To: <871qsl8gt4.fsf@yahoo.com> X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: 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:296004 Archived-At: On Fri, Sep 09 2022, Po Lu wrote: > Jose A Ortega Ruiz writes: > >> After 4-5 days of continous use, a graphical emacs is consuming around >> 2Gb for me, sometimes 3Gb; emacs-nox+kitty, combined, with the same >> workload except displaying images, is under 500Mb. foot is even >> slimmer. > > And what is allocating that much memory? Sounds like a bug to me. A > leak was recently fixed, could you please try again? I finally did, and, under X11 (non-toolkit build), things have indeed improved drastically. With my full configuration, Emacs went down to allocating "only" ~100Mb per day with that fix. Then, just on a whim, i tried to disable a trick i use to hide the modelines, by altering their faces like this (yes, it's a dirty hack, and i'm probably missing a better way): (let ((bg (frame-parameter nil 'background-color)) (ol "burlywood3") (ul "grey65")) (set-face-attribute 'mode-line nil :box nil :height 1 :background bg :foreground bg :overline ol :underline ul :extend t) (set-face-attribute 'mode-line-inactive nil :box nil :height 1 :background bg :foreground bg :underline ul :extend t))) now, when i do *not* use the above code, extra RAM per day goes down from 100Mb to less than 20Mb. Does that make any sense? Maybe it's a red-herring. So, in X11, i am much happier: things stabilise at around 700Mb, with only small increments, and i can also see Emacs returning memory to the system every now and then. Unfortunately, the situation with the pgtk build has not improved at all. I actually think it's gone worse since i last tried: a pgtk emacs running in wayland (i've tried with sway and river) goes up to a 2Gb footprint in just a couple hours of use (and shows no sign of stopping). So there i stick to tty emacs in kitty or foot (BTW, i think the bug fix you mention above also affected tty emacs, because it's also consuming around 25% less memory than it used to). Thanks, jao -- A student came to the master and asked, for the master was one of them who knew such things: "Does Emacs have the Buddha nature?" The master contemplated this for some time, and answered: "I don't see why not, it has about everything else."