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: Memory leaks: (garbage-collect) fails to reclaim memory Date: Sun, 24 Jan 2021 16:20:22 -0500 Message-ID: References: <2a4f3f31f30db28387055821a8edf44fd1d66ea5.camel@yandex.ru> <5c5696670dea31a4647c901be1f87ddb1474f820.camel@yandex.ru> <83tur62iyl.fsf@gnu.org> <6b661d5f325efb3f49e83e2de093b1e271751bc0.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="35648"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45200@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 24 22:21:11 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 1l3moo-0008iW-NQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jan 2021 22:21:11 +0100 Original-Received: from localhost ([::1]:49416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3mon-0002WD-PL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jan 2021 16:21:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3mog-0002US-Kf for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2021 16:21:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3mog-0005pl-Bf for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2021 16:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l3mog-0005W5-5e for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2021 16:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jan 2021 21:21: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.161152323221145 (code B ref 45200); Sun, 24 Jan 2021 21:21:02 +0000 Original-Received: (at 45200) by debbugs.gnu.org; 24 Jan 2021 21:20:32 +0000 Original-Received: from localhost ([127.0.0.1]:37410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3moC-0005Uz-Iv for submit@debbugs.gnu.org; Sun, 24 Jan 2021 16:20:32 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3moA-0005Uk-S6 for 45200@debbugs.gnu.org; Sun, 24 Jan 2021 16:20:31 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3E15A101136; Sun, 24 Jan 2021 16:20:25 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CF83A100707; Sun, 24 Jan 2021 16:20:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1611523223; bh=aFRM3icbGp6HZvFLVY4AGVL1sfwS1MI5QvyfPniiiEg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VBedqCDazqQx0squT5QF/ARGO0kQUYDs4nEg2EGobk9iDQozl8Cn2yBkqwzwHcAeO OfE8zE41+QM1sE6jD+SXWwYn7QzmmrqaMG11GTyD/Z0tTQtoxCGC1/FgH9Dk0Saa6p ypfFrPpDLHes1aXTzL7DWEmZBp526MraiJmSAgUn3B0Ww20q/V4IRpXOjEFbgdGq46 5cB/LqmVf/mqAdtpJfZGWdRa496wT66YDnpNbDsZpJBXELh8QlLiyGAgk6mEVkTGYU Ftj0vN7rQqrvLFb3OSvHFSbIpfLxxGikHzl4gA2edd+fw9W02lNfiI+zE1A1bZb7gF GJ4SqpBTg/WqA== Original-Received: from alfajor (69-196-141-46.dsl.teksavvy.com [69.196.141.46]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 851AE12014C; Sun, 24 Jan 2021 16:20:23 -0500 (EST) In-Reply-To: <6b661d5f325efb3f49e83e2de093b1e271751bc0.camel@yandex.ru> (Konstantin Kharlamov's message of "Sun, 24 Jan 2021 23:21:09 +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:198529 Archived-At: > Sure, they have my report on the problem. In my text I was just trying to > convince Stefan that this is not correct behaviour, whereas he was > implying otherwise. I'm not saying it's necessarily correct behavior. What I'm saying is that the expectation that the temporary use of 200MB should not affect the memory use later is unrealistic. And also that if you (setq gc-cons-threshold most-positive-fixnum) then you're simply asking for trouble unless you *really* know what you're doing (in which case you'd understand that the above expectation is unrealistic). > Glibc could for example use statistics of previous allocation patterns > to see if it's needed to release memory and how much, but this is not > what happens. And I am not the only dissatisfied user. Ruby for > example too=C2=B9. Also, many people experience strange memory usage grow > with Qutebrowser that nobody knows where it's coming from; and after > today's research I suspect Glibc is the culprit (I don't have yet > enough evidence because my Qutebrowser instance doesn't have much > uptime ATM, but attaching to it with gdb and calling `malloc_trim` > inside it already freed =E2=89=8840M of memory to me today). Glib also se= ems > affected=C2=B2. Memory management is hard, and lots and lots of things can go wrong. Maybe you're right and they're all due to some underlying problem in glibc. I suspect that instead the only thing in common is that they're all problems with the memory management. Stefan