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#45200: [PATCH] Force Glibc to free the memory freed Date: Wed, 03 Feb 2021 09:07:35 +0200 Message-ID: <67DDB032-C3DF-4748-A3EF-EEC374EDB251@gnu.org> References: <83k0rz21dw.fsf@gnu.org> <331805c74fc5d3d412dd2065030b11fa3343710d.camel@yandex.ru> <8a91fc16f93298bca1281b43d6821ae3621376dc.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22950"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: K-9 Mail for Android Cc: carlos@redhat.com, fweimer@redhat.com, 45200@debbugs.gnu.org, dj@redhat.com To: Konstantin Kharlamov , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 03 08:08:12 2021 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 1l7CGq-0005rJ-9f for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 08:08:12 +0100 Original-Received: from localhost ([::1]:43368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7CGp-00045J-Cm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 02:08:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7CGg-000451-U7 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 02:08:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7CGg-0000md-Ms for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 02:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7CGg-0001Dv-HH for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 02:08: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: Wed, 03 Feb 2021 07:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45200 X-GNU-PR-Package: emacs Original-Received: via spool by 45200-submit@debbugs.gnu.org id=B45200.16123360704677 (code B ref 45200); Wed, 03 Feb 2021 07:08:02 +0000 Original-Received: (at 45200) by debbugs.gnu.org; 3 Feb 2021 07:07:50 +0000 Original-Received: from localhost ([127.0.0.1]:36608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7CGS-0001DM-Td for submit@debbugs.gnu.org; Wed, 03 Feb 2021 02:07:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7CGO-0001D3-Ku for 45200@debbugs.gnu.org; Wed, 03 Feb 2021 02:07:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37181) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7CGI-0000aJ-3x; Wed, 03 Feb 2021 02:07:38 -0500 Original-Received: from [2a02:14f:80:8d61::1] (port=45338) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1l7CGH-0002do-0h; Wed, 03 Feb 2021 02:07:37 -0500 In-Reply-To: <8a91fc16f93298bca1281b43d6821ae3621376dc.camel@yandex.ru> 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:199178 Archived-At: On February 3, 2021 8:04:21 AM GMT+02:00, Konstantin Kharlamov wrote: > On Tue, 2021-02-02 at 23:50 -0500, Stefan Monnier wrote: > > > > =C2=A0=C2=A0=C2=A0 with malloc_trim: > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (8=2E920371394 232 2=2E= 106283245) > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (9=2E038083601 231 2=2E= 060810826) > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (9=2E140798641 231 2=2E= 0594013240000004) > > > >=20 > > > > =C2=A0=C2=A0=C2=A0 without malloc_trim: > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (8=2E987097209 232 2=2E= 070143482) > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (8=2E700478084 231 1=2E= 7745506179999997) > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (8=2E781121056 231 1=2E= 7870093610000004) > > > >=20 > > > > The difference is just 3-4% (8=2E7 / 9 =E2=89=88 0=2E9666666667)= =2E It looks > to me > > > > insignificant enough to not show up anywhere during interactive > work > > > > with Emacs=2E > > >=20 > > > It's indeed not too costly, but what about the upside? > >=20 > > BTW, maybe a better way forward than trying to convince us that it's > > a good default (which could be hard if the upside is a reduction of > the > > memory use by a few percent: for many people it might be less > > relevant/noticeable than the corresponding few percents lost in > speed) > > is to provide a patch that adds a new *ELisp* function that calls > > `malloc_trim`, which you can then add to `post-gc-hook` in your init > > file when your usage pattern makes it useful=2E >=20 > Upside indeed is the memory reduction=2E How much memory reduction? Can you show the numbers?