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: Sat, 27 Mar 2021 16:13:15 +0100 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="11847"; 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 Sat Mar 27 16:13:53 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 1lQAdM-00031J-RB for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Mar 2021 16:13:52 +0100 Original-Received: from localhost ([::1]:39250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQAdL-0007s5-TZ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Mar 2021 11:13:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQAcs-0007ru-K0 for help-gnu-emacs@gnu.org; Sat, 27 Mar 2021 11:13:22 -0400 Original-Received: from mail-oln040092073038.outbound.protection.outlook.com ([40.92.73.38]:16979 helo=EUR04-HE1-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 1lQAcq-0001zw-H4 for help-gnu-emacs@gnu.org; Sat, 27 Mar 2021 11:13:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mAw53J4Gd+gsvcDcWCuF8P2lpt0SJKotIiILkOmk59Fi1NMWoXIIfDSATXqLGMBYIt7N3HP4xDA6dcajjT3qaVBqs0RN7Hh35+BGZ93kDXT7xLhNyvGWt9O4G7AXFRM/1NT66n15ajGQBD5IVlmTIiQTMt3RxUEbcBNFde2j+RReyc6hdoAsa+Z0natbg+ihUyYapPBC593VQhNaYuVy8gQ1Re7CrljUdOT91ZamiQqDHzQ21qb6ZL7A7dD4lnx8Odgebrr38ZJJHzRPyithhnHEru+M/WgmGoHmOe+AfFoW30T4XWQhE0Mh8TgdtnZlBosV4BiShRJmlSVBKe5Tog== 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=BWsTANwyLEfPZWxWK3yutFGQTuzDl9i41PPvBi51UME=; b=gYf41/9oiyUf+dyZG5Vkl9QWH5FHXdzdESjkWDwxyKC6lIj3zDnwLTV0FSw11JDr1wfp+iorHhRPBm6uSJsDyjxAs80HvdG3tFMg1GVXtJXiWokxX9lgCiFHLaSeI03QJGC9ijAsdlfim3QwMnToFsejtmq7vGfUwRrQu54CwZiCbFyBHkWcTcqgq1rphYlCoNQhiwD8quhLLRewZHAR4Crv0lTfHNjWP8vKyerDsTrWiPRlknDppT+PfBtnyrlqE2g8TxmR1ZBCFGtRpiEs2X4ZZOOmZzeFKO7chAOnV/xi1LmMzth8DTbewsZSriSzL5LsIADrjFMipj8+JyTZGA== 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=BWsTANwyLEfPZWxWK3yutFGQTuzDl9i41PPvBi51UME=; b=OzvdAUaDUOsvtBu+XYrmCbGDXS6TEnsMsQa2b3s1nTX+TcGcJvrD8IFc3Szhmh7Bob2k8u9mOtF6oWjiZHVPYgjBheGfUlJuh4W2ns+p2sIxvI62RtSPxlTrU/QXOe2TbE9sKfYKdWZdNRQcc5IutnIP8bYMCA2ubO7zA6URiBNYX9ZciGtgcJCoIkiDKsJ91Z1+QMIsL7Nyz0kByCOgkq94D7Gx7qOymojqNDRrxvEijE1kOrSx461Wc6P36O7wo3z9DMl5Q5DnAj7Wa0ye5sN4+Yre0yOJzk2tFXj94UX1i0us+1Y0oZtIIZRDiwlRiBSf2xythc3BsQyJaTCMkA== Original-Received: from DB3EUR04FT022.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0c::44) by DB3EUR04HT053.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0c::326) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Sat, 27 Mar 2021 15:13:17 +0000 Original-Received: from DB9PR09MB4986.eurprd09.prod.outlook.com (2a01:111:e400:7e0c::44) by DB3EUR04FT022.mail.protection.outlook.com (2a01:111:e400:7e0c::285) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Sat, 27 Mar 2021 15:13:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:1C562C5C0AF71B4208EE9EC01BED9A984C378AFCC8284931C360E04E15CE562E; UpperCasedChecksum:78DF999F4BCB28849E9A14F61785E5BCE231D008559B74C66E83DD387F7C06EE; SizeAsReceived:8195; Count:46 Original-Received: from DB9PR09MB4986.eurprd09.prod.outlook.com ([fe80::940:96e9:22e5:8403]) by DB9PR09MB4986.eurprd09.prod.outlook.com ([fe80::940:96e9:22e5:8403%6]) with mapi id 15.20.3977.032; Sat, 27 Mar 2021 15:13:16 +0000 In-Reply-To: (Stefan Monnier's message of "Sat, 27 Mar 2021 11:03:24 -0400") X-TMN: [JmecSEkpptPfEswqu4OgL83SJqSxeP9O] X-ClientProxiedBy: AM6P195CA0014.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::27) To DB9PR09MB4986.eurprd09.prod.outlook.com (2603:10a6:10:2a9::19) X-Microsoft-Original-Message-ID: <87zgyoaaus.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6P195CA0014.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Sat, 27 Mar 2021 15:13:16 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 85af1192-b76e-4128-d1b5-08d8f132d904 X-MS-TrafficTypeDiagnostic: DB3EUR04HT053: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: obl/Q+J0RmfOgrad4bhJb0sLwU9DGPrOzi63XKt2Iky4nRbvRD9RlOB2iyEakxAWUPvTq6EUAoGRxgTXTMVXclWu5slOBR1xbWP3DpPVP7gtgg2WvYGSD401NnxEqljxvHz22ZJiY+ENOJnVkl8isLLMPoHw5StxHtzsFLhGAy3HDCP/nXRAhnpEdOGToGOtx0ki2BYjFzX0OvG2B9+Bty3tBRT+8ZBbYSHD6XVLt2fVp7tTwbg/FqfIrob5ZPkCvusFjs/CsAVLKWnxqRFNd9g4SP2EwTN+D9zQ6wnLMSGP0NRLehuXND3Aj++CRh/TDn/vbudsKKQ4YY4C1Q07cmwXysVzwJw6qNOUFlKrjLWvNswx0mqpvplM4Q619I+bmDkDnFKQ8cL/bHUCGkabXQ== X-MS-Exchange-AntiSpam-MessageData: 9WtWw1hDbgsCdVRzg5Vl9exJGbUhKaRVA1QgJhZiyblOilh8pLFgVAth6aR8KaSD+UI/hcb81Ck4qh0L/bAb/AIvzrrJZ8zypOKPup2J5pkwZpfo7VlqlEAKephyyGRlLLu6PHzAuJjQ2DVLpCAWDQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85af1192-b76e-4128-d1b5-08d8f132d904 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2021 15:13:16.9175 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB3EUR04FT022.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: DB3EUR04HT053 Received-SPF: pass client-ip=40.92.73.38; envelope-from=arthur.miller@live.com; helo=EUR04-HE1-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:128717 Archived-At: Stefan Monnier writes: >> "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. Indeed, and I didn't ment undo as a single of slugishness either, not does it even have to be slughisness. That is why I say "bunch of stuff"; unspecified :-). I ment a single place where user, mode creators etc, can add bunch of setq vars to nil and would be explicitly called by user from some function; something like reset to starting state or some kind of that. I said in some previous answer to Eli, I don't even percieve later versions as sluggish. I got ideas when there was that memory leak, and I just suggest it as a mechanism for the future, in case of. > 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. Better than nothing! :):