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 16:53:58 +0100 Message-ID: References: <87pmzmihyj.fsf@robertthorpeconsulting.com> <83lfaaot5h.fsf@gnu.org> <83k0puorpb.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="17580"; 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: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 26 16:55:02 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 1lPone-0004QN-JN for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 16:55:02 +0100 Original-Received: from localhost ([::1]:42022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPond-000204-II for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 11:55:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPomn-0001yX-1D for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 11:54:09 -0400 Original-Received: from mail-oln040092075073.outbound.protection.outlook.com ([40.92.75.73]:1760 helo=EUR04-VI1-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 1lPomg-0004LJ-Ji; Fri, 26 Mar 2021 11:54:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HQyCNT/LGMCBLaG2gIMykiibKkEs7HqhKFmXtpD+b1RTTFyU0zQJE6le2388zjKDKtbdOI9tY26ow5Llaz2aWXFCJMlM+V9NH+4z85/5RGyHBWZTMvKoUrDePs0N+t2Z+Oc+ZPM+1wVsC8FmScj2+zW9xE+ySfPkTDSkHzOJeTrzcE4VGww1GnKZTj77MWenHA/jTtQAE+xuYJcvN8OSdTO71wRG9zRWE+CgHE5+2DJKi2tB+tnDtYXQ0AeqHmPaJKtsxasgfJ0Np+vIWNOvE5jWIB/r7Z7Fezeh7LmUrzjqaq/zj2uqgvfbz7su8uKxvIRkPI6StZon7UZWlBWl6Q== 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=8sBaXPQHk2tYIA/lIC6Pc6+XavnTEDRBtxvbtAgRP1U=; b=aDIdV+ruxVPoquhpxqmT6bqCmGGsiYknHU111grzXysujfwD/iNIyaGc9SIaNfgCi7nsmleA1aEa88rdFfbPgqe/pIRxXhObdp/FJEg9NN/IUfntyFk7aUm3Ut0TCYvWYts0DV7e9afZZj0FYtL/orJ/p36oWt+EjYqQBr+e/WKjrMaAoTQeaGqdRknEIJBhFm+XQF+TOiO/LzFV3BeXQHQgQNfxzW4deMwAjdZHES1yyKW59j8T95G5wz1MA8J9fv2lQ5njPjn4KpVJJg8D0BFZVatOGXw7nlsF4G2mRtKdH2fh1Rn14nrfEmjUmiZJkttPgaCeyRbc5o8W6Dy2zg== 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=8sBaXPQHk2tYIA/lIC6Pc6+XavnTEDRBtxvbtAgRP1U=; b=JQaqLPb3jbbvlPYXK5dNs9E0z6XzKjNrUCnXy4jloD8l/0wexcvm5PZVIru6Y6Jx6wdzFrBSkoLJ+2AP3cEd5Zu3O5joF2EIfgdnErBM5Kz21We83n+ninORqZRc1tRNrbtQ/RLVASLG4K+ZpQH2yxQIZDziC+p9TEhWveQKGF0Yf2NzE/dCShOvC5XTngW8szlyM2KvEsPGssyDgP0KCTDVFr0HPIl8qTdR/ewsgixc+GVUmuKJhkBI+pJ8Yh4fJ7SaDsBzuRmMbJe05JJx/S9QvcSYEQkdHYPqrQB12ISrk9LxRslHx2wjbK7zhSuC1sgm/BEpxF0O14OG0sVeVA== Original-Received: from HE1EUR04FT005.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::53) by HE1EUR04HT168.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::380) 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 15:53:59 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0d::41) by HE1EUR04FT005.mail.protection.outlook.com (2a01:111:e400:7e0d::275) 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 15:53:59 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:D359270666D0C12B8FE43304EC889604E302F4A281E505A9C24B9CAD83782349; UpperCasedChecksum:B4AC3AB4B5A496C4A057353B2DD33FBF614159D01041044A6116FBFF1D176047; SizeAsReceived:7692; 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 15:53:59 +0000 In-Reply-To: <83k0puorpb.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Mar 2021 18:33:20 +0300") X-TMN: [gkvpII41L7Kv2k2nGuuycakcRqN14Tih] X-ClientProxiedBy: AM7PR04CA0016.eurprd04.prod.outlook.com (2603:10a6:20b:110::26) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87ft0hlxm1.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM7PR04CA0016.eurprd04.prod.outlook.com (2603:10a6:20b:110::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Fri, 26 Mar 2021 15:53:58 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: e55fb5ba-a73c-4ac0-45f8-08d8f06f5e5a X-MS-TrafficTypeDiagnostic: HE1EUR04HT168: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2L3sT5V0B4k3+xQ7XHHR8IbbQViNxT+6HO8D5XX/fz6Mp+OxoQKU27SyBeXFPoXe73AbcWfaQ9aRpqOUCTrGxzF9HuNKgP7qd8SUqCeYMICP8+57UjxhlZaytBgomxkf/YMQHXd0mnDXo46c8j8qW4eG9gw/SkPVLyzDo6bakPOEAxnCns1hVb4jGk13iV6sKY/iEk5JEBKUSLLRJsqEqFsKpoMQP8vGoW0ZzzwlTjQrCkHf8ZOfP9b4ujCn17wwaVhnMVzhFBPSJQTXxq7LiJBWEgnxDQAMSsNNLRBM6isQdgpraKOI4B7y/qhGHa+4hSHXz+4ZeswNYOZYP1yQhyDhcSc5X32BnCUwcvk6+QJ3oSoCrrWCHeb+CJqEvri1NhvStaVQVQcnZ1jdftMJyQ== X-MS-Exchange-AntiSpam-MessageData: NuIMi73HfDN8MKX85EGGUS2ccg1+D+X3A98gbNMoDmBpZDLSeuQXrmMG73oTYLnH0Mk+ByktrjGGej6SN5iISINsIHpeimzAHJCkLnqFZDImetG2OUX4DNmB4hMfD4lHvct9UlBGhJpgCWRGBqwSHQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: e55fb5ba-a73c-4ac0-45f8-08d8f06f5e5a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 15:53:59.0823 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT005.eop-eur04.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: HE1EUR04HT168 Received-SPF: pass client-ip=40.92.75.73; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-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:128646 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: help-gnu-emacs@gnu.org >> Date: Fri, 26 Mar 2021 16:09:33 +0100 >> >> > That's what GC does. >> Yes, but GC can't know if I don't need undo history, right > > And neither do you. GC compacts the undo history, though, and frees > the slack. Ok, good if GC compacts the undo, but I could explicitly wish/know sometimes that I could "freeze" the undo. I could just put on my own interactive command that does this instead of using M-: (setq buffer-undo-list nil), but there could be some other stuff based on mode, like eshell or term or I don't know what. That could help GC. >> or old text in eshell buffer? > > Delete it, and it will be free'd. Yes, so that is what I am saying; a hook to put all kind of various "delete" stuff for various modes so we can run interactive command, say "clean-buffer" or whatever, and it will run the apropriate "deletes" and maybe other stuff based on mode. >> Can we maybe get a "cleanup-hook" so we can specify per mode which >> data/variables shoudl be set to nil so GC can do it's job? > > It's much easier to delete unneeded stuff, and let GC recycle the > memory. :-). Yes that is exactly what I ask for; a hook where we could put what will be deleted and that will be called on user request interactively. Just as a note: no idea if you have found the memory leak or not, the big one that everyone was repporting few weeks ago, but I haven't experienced any leaks or slugishness with lately builds. I guess you found it? :).