From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#45200: [PATCH] Force Glibc to free the memory freed Date: Wed, 03 Feb 2021 23:28:54 +0300 Message-ID: <542372cc86c88931a80574dd61c5342023424cca.camel@yandex.ru> References: 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="17782"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.38.3 Cc: carlos@redhat.com, fweimer@redhat.com, 45200@debbugs.gnu.org, monnier@iro.umontreal.ca To: DJ Delorie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 03 21:30:21 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 1l7On6-0004VY-K3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 21:30:20 +0100 Original-Received: from localhost ([::1]:49798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7On5-0003ia-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 15:30:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Omq-0003hf-8K for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 15:30:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Omo-0005TH-TR for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 15:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7Omo-0003YY-Nn for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 15:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2021 20:30: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.161238414513586 (code B ref 45200); Wed, 03 Feb 2021 20:30:02 +0000 Original-Received: (at 45200) by debbugs.gnu.org; 3 Feb 2021 20:29:05 +0000 Original-Received: from localhost ([127.0.0.1]:38957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7Olt-0003X3-KG for submit@debbugs.gnu.org; Wed, 03 Feb 2021 15:29:05 -0500 Original-Received: from forward101j.mail.yandex.net ([5.45.198.241]:58018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7Olq-0003WY-Fh for 45200@debbugs.gnu.org; Wed, 03 Feb 2021 15:29:03 -0500 Original-Received: from myt5-5c2d79a89c75.qloud-c.yandex.net (myt5-5c2d79a89c75.qloud-c.yandex.net [IPv6:2a02:6b8:c12:1f22:0:640:5c2d:79a8]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 27F3B1BE1294; Wed, 3 Feb 2021 23:28:55 +0300 (MSK) Original-Received: from myt5-aad1beefab42.qloud-c.yandex.net (myt5-aad1beefab42.qloud-c.yandex.net [2a02:6b8:c12:128:0:640:aad1:beef]) by myt5-5c2d79a89c75.qloud-c.yandex.net (mxback/Yandex) with ESMTP id L6n3n3QCmb-StIeUCpd; Wed, 03 Feb 2021 23:28:55 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1612384135; bh=QBZKKmPzFXtXKcNNv5UtjiW0OKQ+78/cgxqsmIYoEMk=; h=In-Reply-To:Cc:To:From:Subject:Message-ID:References:Date; b=irTFt88ORRN7ct5HCPqmQT0CfElA+sdk4OBnbKt3Y2TJ2JQkIyGToZp7a9ayFBHTH sTydc1s1tCQONL6sg2sCwAfUKCI068HDZxJdE8gQrXxQ3ys0yshHAg4/qy8+1PSUXc qhwlvIuSgFbxqpbrAo9G/TElqaOVMEH6s/fRxCno= Authentication-Results: myt5-5c2d79a89c75.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by myt5-aad1beefab42.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 0KI4iIblaP-SsnCMNNi; Wed, 03 Feb 2021 23:28:54 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: 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:199242 Archived-At: On Wed, 2021-02-03 at 14:36 -0500, DJ Delorie wrote: > Konstantin Kharlamov writes: > > > So I think we need more info: do the glibc maintainers consider it > > > normal for glibc to behave this way?  Why does it behave this way? > > > > Very good question! I hope Glibc mainainers that are on CC list will be able > > to > > answer. > > The answers are "yes" and "performance".  Sorry. > Thanks for chiming in. Let me rephrase a question of mine: right now, Glibc behaves in an odd way: α) sometimes, call to `free()` frees memory completely β) sometimes, call to `free()` leaves memory lingering forever, till malloc_trim is called additionally. The answer I'd like to know is why do you not do always either α or always β? (I'm leaving out here the question of which way is correct and why, I'm rather curious just why the difference in behavior).