From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#45200: [PATCH] Force Glibc to free the memory freed Date: Wed, 03 Feb 2021 10:15:17 -0500 Message-ID: References: <83k0rz21dw.fsf@gnu.org> <331805c74fc5d3d412dd2065030b11fa3343710d.camel@yandex.ru> <8a91fc16f93298bca1281b43d6821ae3621376dc.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8820"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: carlos@redhat.com, fweimer@redhat.com, 45200@debbugs.gnu.org, dj@redhat.com To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 03 16:18:25 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 1l7JvD-0002A3-NW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 16:18:23 +0100 Original-Received: from localhost ([::1]:45458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7JvC-0003oz-NA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 10:18:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Jsx-0002Zo-Kb for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 10:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Jsx-0007ev-Cy for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 10:16:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7Jsx-0003N1-8b for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 10:16:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2021 15:16:03 +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.161236532712859 (code B ref 45200); Wed, 03 Feb 2021 15:16:03 +0000 Original-Received: (at 45200) by debbugs.gnu.org; 3 Feb 2021 15:15:27 +0000 Original-Received: from localhost ([127.0.0.1]:38602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7JsN-0003LK-HN for submit@debbugs.gnu.org; Wed, 03 Feb 2021 10:15:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7JsL-0003Ku-Iy for 45200@debbugs.gnu.org; Wed, 03 Feb 2021 10:15:25 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5B774440981; Wed, 3 Feb 2021 10:15:20 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D41024408F6; Wed, 3 Feb 2021 10:15:18 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1612365318; bh=8fYMXYB+zpglYsh8FQyUSLeFQyVlkJuV7y8A93NygEI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Edktm6pHBF+rFMbOCFNsXu/LHHlQCC2jk9bxdGFcT962fopdE4IALhBaj9NRzswsB 3QgrTSJfaYzkLKsNejHoP87oIQT9X+j+pW0B8wMnv8cdaNIlxOy4MB6JziyIHoQVj7 7ercPvz8irEannzchcZQNz0zjKnnrn+Yp/xM7Wtj/TNWf30hdRM19LcVKzWSw+gb1f 2zpb7gAin/PlRZ5QAP+iUYiJr5jm568AAN4rMMgwxxt/ox1KwCieaJGpvPIxQWDcAS ZDu/XjruCmcfM3PnLJijsWHo6ltVIv1TDpaTx4kEeSWUAXnEcxArFvYso24ufBqxlx QW78KC/2HewUg== Original-Received: from alfajor (76-10-182-85.dsl.teksavvy.com [76.10.182.85]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 96F7812047A; Wed, 3 Feb 2021 10:15:18 -0500 (EST) In-Reply-To: <8a91fc16f93298bca1281b43d6821ae3621376dc.camel@yandex.ru> (Konstantin Kharlamov's message of "Wed, 03 Feb 2021 09:04:21 +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:199203 Archived-At: > Upside indeed is the memory reduction. I expect so, but the measurement is the thing we need here. How much is the memory reduced (in the case where the GC vars are left to their default value)? > Well, I didn't send the patches for my only benefit, but for benefit of > others people. The new ELisp function is something that not too many people > would benefit from, and I mean, including those who disable GC. That is > because it would be an opt-in feature, which you need to know about to > enable it, and not many will ever find out about it. If it's very useful even with the default GC settings, then there's a good reason to say it should be enabled by default, but if not then I'd expect that those people who set their GC vars manually will learn to complete their GC settings by adding that function to their `post-gc-hook`. > For my-only benefit I could just continue building Emacs with my patch > applied locally, as I do now. Yes, I have my share of local patches as well ;-) But I think there's a good case to be made that it can benefit others, Stefan PS: BTW, we can arbitrarily reduce the percentage of CPU time spent in malloc_trim by only calling it every N times rather than after every GC.