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 16:44:17 +0200 Message-ID: <83v9b943em.fsf@gnu.org> References: <83k0rz21dw.fsf@gnu.org> <331805c74fc5d3d412dd2065030b11fa3343710d.camel@yandex.ru> <8a91fc16f93298bca1281b43d6821ae3621376dc.camel@yandex.ru> <7ffacc5f-fc0e-a5f8-104d-2c0ae8e06953@gmx.at> <3f4f8b3034e9f52f48ec520f2732b1687bb24dbc.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16164"; mail-complaints-to="usenet@ciao.gmane.io" Cc: fweimer@redhat.com, dj@redhat.com, carlos@redhat.com, monnier@iro.umontreal.ca, 45200@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 03 15:46:24 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 1l7JQG-00045h-GO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 15:46:24 +0100 Original-Received: from localhost ([::1]:45150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7JQF-0003VN-CB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 09:46:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7JOx-0003UI-Fh for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 09:45:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7JOw-0001cJ-8T for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 09:45:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7JOw-0001vI-70 for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 09:45: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 14:45: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.16123634687321 (code B ref 45200); Wed, 03 Feb 2021 14:45:02 +0000 Original-Received: (at 45200) by debbugs.gnu.org; 3 Feb 2021 14:44:28 +0000 Original-Received: from localhost ([127.0.0.1]:37376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7JON-0001tx-Nn for submit@debbugs.gnu.org; Wed, 03 Feb 2021 09:44:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7JOL-0001tb-Op for 45200@debbugs.gnu.org; Wed, 03 Feb 2021 09:44:26 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43894) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7JOF-0001Cq-TI; Wed, 03 Feb 2021 09:44:19 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4291 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l7JOF-00072h-E2; Wed, 03 Feb 2021 09:44:19 -0500 In-Reply-To: <3f4f8b3034e9f52f48ec520f2732b1687bb24dbc.camel@yandex.ru> (message from Konstantin Kharlamov on Wed, 03 Feb 2021 11:23:43 +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:199196 Archived-At: > From: Konstantin Kharlamov > Date: Wed, 03 Feb 2021 11:23:43 +0300 > Cc: carlos@redhat.com, fweimer@redhat.com, 45200@debbugs.gnu.org, dj@redhat.com > > Second, most importantly, what `malloc_trim(0)` does is it restores the correct behavior. I mean, what's the point of ever freeing memory if it's not freed, right? The purpose of freeing memory is to make it available for further allocations by the program. You seem to interpret "freeing memory" to mean that memory should be returned to the OS, but that's not necessarily true, and isn't required to allow the freeing program be able to allocate more memory in the future. > The problem we're dealing here with is an actual bug in glibc⁵. What this implies is that if the fix indeed hurts performance someplace, well, then it's that this place requires additional performance-related fixes. As opposed to just ignoring the bug because of performance got somewhere decreased. Things like, changing the slow algorithm, or modifying GC behavior for specific usecases… The fact that the bug you reported didn't get any responses in more than a month, let alone wasn't fixed, could be a sign that not everyone agrees this is a bug...