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.help Subject: Re: How to debug memory leaks Date: Sat, 27 Mar 2021 11:03:24 -0400 Message-ID: References: <87pmzmihyj.fsf@robertthorpeconsulting.com> <83lfaaot5h.fsf@gnu.org> <83k0puorpb.fsf@gnu.org> <83ft0hq4wb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11324"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Arthur Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 27 16:04:11 2021 Return-path: Envelope-to: geh-help-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 1lQATz-0002oI-3k for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Mar 2021 16:04:11 +0100 Original-Received: from localhost ([::1]:34628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQATw-0005NK-KK for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Mar 2021 11:04:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQATL-0005Mp-Vv for help-gnu-emacs@gnu.org; Sat, 27 Mar 2021 11:03:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQATH-0003yu-Kc for help-gnu-emacs@gnu.org; Sat, 27 Mar 2021 11:03:30 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E8098441379; Sat, 27 Mar 2021 11:03:26 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A21F0441278; Sat, 27 Mar 2021 11:03:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1616857405; bh=x12M+hsVZ1QuUt9WGvhOO/+eo1++pIcnK1qGVFVtCTM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=MdXQvZMPX8Kglw5quvIjytjtzd5dQvi2fyhKjsjiCm4wpMAVs1KVnj4y8hqIAoSGi vO9sBiUJsumftP/v3m/rYQIaf3BZVwUuTIEIlK6OysF2WfZCcJ5dPLRknZXg4n7wK4 F/M9vXHI25Zb9QOdMHPdLwWu/Mwj9CGdmCoNE+U35KHUSuKvOWdg6MkAq/w49unT6H pl9Ulsqzcl7i+/spDY2TLcwoqUEOzWtNRxp8ROkSM4lxTOy8w26cYzDbc48CrhqyTn gNRpppyhXP67lL053op74xlyMlRG17wzVNXSDvQy0CZSzvQrxKXZurWxjYclXSf+Kv 3nOFkLaFMgWcQ== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2750E12024A; Sat, 27 Mar 2021 11:03:25 -0400 (EDT) In-Reply-To: (Arthur Miller's message of "Sat, 27 Mar 2021 09:20:40 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128716 Archived-At: > "Source of a problem" is probably a bit too heavy expression :). For > example if I have had a file with lots of undo history, I wouldn't say > it was a source of a problem, but I might decide that I wish to get rid > of the undo history, and start it from clean, without killing the buffer > and opening it a new. I don't think I've ever seen the undo history being a source of sluggishness ;-) >>> I used undo history as example, but I ment bunch of other stuff. No idea >>> how much it would give in practice though. >> So, there's no concrete existing example of stuff that could be added to >> this "cleanup hook" :-( > I was trying to reason in terms of a general facility. What do I know > what people use, no idea what can be "throwable" in different modes. The problem is that sluggishness (just like excessive memory use) can come from many many different places. So it's hard to come up with a tool that handles "the usual suspects" because there are too many usual suspects. What we have instead is `M-x profiler-start/report` which should(?) let you find out what is the source of the sluggishness. Similarly we have a `M-x memory-report` for excessive memory use. They don't work great, admittedly, but this is a hard problem. Stefan