From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.help Subject: Re: How to debug memory leaks Date: Fri, 26 Mar 2021 15:57:09 +0100 Message-ID: References: <87pmzmihyj.fsf@robertthorpeconsulting.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32957"; 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: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 26 15:59:01 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 1lPnvR-0008R2-Av for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 15:59:01 +0100 Original-Received: from localhost ([::1]:38968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPnvQ-0008A4-8D for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 10:59:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPntj-0006pA-Ar for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 10:57:15 -0400 Original-Received: from mail-db8eur05olkn2050.outbound.protection.outlook.com ([40.92.89.50]:45728 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPntg-00032d-MO for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 10:57:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZtaatSY0JMZKlq6k8Zo727uXZ39TDgVYFV26zrefUk5c2RJqczhr+2FKfrf3I4lVmoSdsQzOM3G+vG4HmZC1HiGpIWOyRLi9r3E90nfoH+EHL5xc3dRieT4yOA0bL2TbxqteqibmHM1VLr7TXgZYYj5XnXZaBTUemfwjw98FfzBS96YiU9xoODSmr2XluUgIWBaAAXPptYWz/e8FsYZTpchtzwNaZ+ebu6gvIDInQAJIt0o4w024DHzlsaJkY7UuEx7Ra8yxENFwtSXjiNzkQS0o5nbx7qj7DlTilszGnq7ewKoPcsHe1+2LdGBZ0UobwKxo8camK2yEmqMQArEkgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y27D6/GzUMXNTP+dIJyvKIIhqly58b32WIPZV8JZtYY=; b=AMRImR4XWUc6LEsrnI0sguJwRax5npEzp756TWeVYr7u2J3jZ8UqCddZCpk50toLwJaaEQhB8v2yVGgrX8w6JPigMI+oPdj9fDxKrgCdrK/0QPQ3SCqJdyrXYxeW594VMtvq30cvxT3qdxwBrD1n6VrjyBQSmt195Rz2ul4mY1ECzcZMVbYzFb5DHldsQVP32u9ZOx7H97vEBVsXFsF1OV63Hs28SOJbUCtw1D3D5MORotxp7T7BvTS/YLooRSuAg9tsAxmsdWXCHOXyUSOIsfY0q20T8+kDVFaeX245HEmkMZqW2QcAzMnnp5vdbuj6R/xSXihKcfvYh9A6QtZemQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y27D6/GzUMXNTP+dIJyvKIIhqly58b32WIPZV8JZtYY=; b=aWC1QtsWcXkxlr2Ow0pOodKsLdr1/fSf79ZYI0wmVT4XyYBBK7InrWtEpw9B9hf4prJZs8AXxBRHhygP5lgUWz2LDWj+aDf+pI0hv+dGkT1vcgLCnrq8Ds/e8uhpPNRg5+onTH8gOKRPzhvNfso/Yvw+s+2+GHPiFCtUZlo1Eo8GwQrTLaPj+wSnUpHUu5EAKjHxVZkNeN8GoHDM5mscoFnPOmEUIzwjchWFQwclg/tze0LYI2DLJSKOUJ8CcYEv4Qj+bd0xJIVtXOd6oxCDGSxla9hGYTFbfPhr3hBTQcRvfi391MYB5rCSP+2oc1XWYdpqICWOoS1GYSR9vbDwrQ== Original-Received: from VI1EUR05FT006.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::4a) by VI1EUR05HT138.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Fri, 26 Mar 2021 14:57:10 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc12::40) by VI1EUR05FT006.mail.protection.outlook.com (2a01:111:e400:fc12::94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 26 Mar 2021 14:57:10 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:92131CF5BE0AC9395703A5352B6B7923C159714E627C36FC1B3DC08788D3796E; UpperCasedChecksum:B29B1A0A5199BB39908794CAB5D90D4D435901D2D340E43E554956D6F9696725; SizeAsReceived:7501; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.3977.025; Fri, 26 Mar 2021 14:57:10 +0000 In-Reply-To: (Stefan Monnier's message of "Fri, 26 Mar 2021 10:11:02 -0400") X-TMN: [qHWQui6c/vg/bJbE+zk5K7gHSt8V/xEr] X-ClientProxiedBy: AM5PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:203:3d::23) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87o8f6kloa.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM5PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:203:3d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 26 Mar 2021 14:57:09 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 56690078-3d24-445c-ab12-08d8f0676e7f X-MS-TrafficTypeDiagnostic: VI1EUR05HT138: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g0sZ542qbuShtfxX53gTwRifePKXmWZG7J6uBVkw9LEourTqjBHfxrgdJ/RdmxgMhv7FuCZv0VkTdT6tKvXUmS0XrLu3X8yh8Ee8FNIh2KajyByOr2xWPFsHOnkhdlKQbbHho9svu70rSGjFs1BnPw1ITzKQJzLFqAmSzz76diDcQJPSVGk6NYLun+AjjyONCMgqndtKUaRNxbqhuXYrV6YMsZHW4mrojK6QyWt6QauxzwehqueC588j5Qu3XCqKFA8np19W6eMyNwsQc01J0N0BnNUi03pGMUvV0h+n9EYdtSt2FTEmkiDbX6BONLT43n4StWt43EF+IdBlvWV0KmExrHFqaFG5hQH3Qsyijh/nnYb0spWm1tyMpM/jg3K6rfh25tFhNKZMMz6lsrB9lw== X-MS-Exchange-AntiSpam-MessageData: 27wT1jcj8dqAjddXRU1UnkPH257GfVNVLwGGSiPiEihYSdKesz1DZxL8I3FOXXYF8rQ53Cmqo9zqDXKnh3PU1GnCDEmHKrOO7PAoyYEkHebfSiEK+xHgYHfJuqaPtOgeewWyz7RTJJ2PJb8wXol81Q== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56690078-3d24-445c-ab12-08d8f0676e7f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 14:57:10.3454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT006.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR05HT138 Received-SPF: pass client-ip=40.92.89.50; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:128636 Archived-At: Stefan Monnier writes: >> I think you mentioned a while ago that you use shell-mode. In that mode >> Emacs keeps a buffer with all of the shell activity in it. By default >> it doesn't remove anything, at least on my Emacs. > > The `M-x memory-report` in Emacs's Git version makes these issues > immediately visible. > > Sadly, in my experience the kinds of excessive memory use problems > people experience come from elsewhere (such as the occasional need to > load all the fonts that exist in your system to try and figure out if > you have a font that can display that damn emoticon that your brother > found cute). :-) Would there be any way for Emacs to unload unused fonts? GC? As a thought, could it be possible to implement something like "clean emacs state" or/and "clean buffer state". It would throw away undo history, unload unused stuff, for example in eshell/term/ansi-term kill the buffer text, etc. Something that would work either on entire Emacs state, or just on a buffer state; or maybe on both. Is it just to set some variables to nil and collect garbage or is it more work than so?