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 17:32:54 +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="37197"; 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 17:33: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 1lPpPD-0009Wx-Va for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 17:33:52 +0100 Original-Received: from localhost ([::1]:34488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPpPC-0006pZ-Th for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 12:33:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPpOR-0006mx-R4 for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 12:33:04 -0400 Original-Received: from mail-oln040092075038.outbound.protection.outlook.com ([40.92.75.38]:50914 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 1lPpOO-0001sW-Q2 for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 12:33:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=beIwcSs5F82DLhJGyxk8gc9+xvlYgUly+QymFXBtzbmJQvD4S3KpUzqXdDSVoJY22Toh99TDwGDJnsD3c5XMeSPZxfozSA4w70nOep4OuRFqNfWIgaxRKkZNdlUZpITd8dOzoIwyb9X5OIFABLpGVJ7gfAPsYYIQINyoeo87nilHcvz28n8oPEvkGO1X9OUfYZisrGilVacWPPAZrSjHCvX/xH+XmOOU8N4JefIGPizMS+a/yVLVs2TnJa+nm0JNAveax5bG/nOgT+SqIAazNZ/We51wiewCe/OZVyYhNGvZYzZBENiz3vbVlHMlvp2b7HARHeZiyf85CD3zhaqWkQ== 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=/C70czLwW0iZ4j5wLQIEQpCWJxdX4DkwfvxxVH7dD2M=; b=GUJRSrckO4nHfvMB8tUH43B0oGqlxyTj9uvQkx20PPTQDcIEkd8MHOK8OcKKjUiM9vTGfKa//s0JkA4sf7S1Hxpk8uk45OzzOM7eKHHjZHVxYdijff/tbLGhlvhcRM1IfK7UkLAOgdgJgR8sVLebBvzvP6wV7j9eErwyiTkxwXhoBEP3+eXm758wN2Wh9wF6tn3o3DNopOEx/J3mB0QHcI6fTiILEcSXSdyRCBm4ZeFRTA3xDESkMeO5+VMR/TNKSdn4zRv0IVm0Gi8fJC3EgSdo3Hl16reTwlUbrUO0WHMWA73PYo9V4eCp+bQqZ7EP9sMTO8dP2PiilOrq4hXIrg== 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=/C70czLwW0iZ4j5wLQIEQpCWJxdX4DkwfvxxVH7dD2M=; b=eldC9wmVPs2TdI/HtkeViJtJpMElFLrCsCDcLW8hyPdAX4wr4BguPiLeyvIVovfW8G9hSNEpQVpz4nr3d0hYYkdu5DS1PfSe56n/Sm9Fw5LysW+tYJaCG/GL/k0W1IZvJs6LfMzpyYRwSt+q0MCHZBA7kgl0nYRWUuFEsSX4Tpwq2YDIMujTSGBo+hJwgz/gS8Wblk5CKjmvTu3ZUaLqSZhWTBmU+Zotct+SDBALw2zVkFu+50uROigMdiF1aC4FNwGVj3i06KFRjWbGcD4Yy7KSHMrmzwFdMSL2WBE0V2J9bB0hZVooGV1B7D0yeB/1ddx3svQi7VODnJWTqMzmRg== Original-Received: from VI1EUR04FT013.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::53) by VI1EUR04HT158.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::324) 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 16:32:55 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0e::46) by VI1EUR04FT013.mail.protection.outlook.com (2a01:111:e400:7e0e::175) 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 16:32:55 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:2CBFCAD611D069EEECA6ED646D369E106B445E8978B4638B97984A9DCD3ABF89; UpperCasedChecksum:DF1CA86513DA4353CF1E07B695AA558F3ACF58B39B65A513E89F0244FD12149F; SizeAsReceived:7956; 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 16:32:55 +0000 In-Reply-To: (Stefan Monnier's message of "Fri, 26 Mar 2021 12:25:05 -0400") X-TMN: [5SD+lKbOXjABe6q/TrR23jsn89c1EMao] X-ClientProxiedBy: AS8PR04CA0188.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::13) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <874kgxlvt5.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AS8PR04CA0188.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::13) 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 16:32:55 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 6f6d8fa9-d2fb-4b71-697c-08d8f074cf0b X-MS-TrafficTypeDiagnostic: VI1EUR04HT158: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9K79rxpLPZzu2vooFX7p5RXoM5GK+n0Js7/Yjvrz5SRFlR7FzQt7tnhNsmY9N35euLKZyKqwfLFtfUKBRAknlxlJdMNMyaCNI4qIUj7cHnUPpaY+GeJk0SY0T3m517QLHZwlNC7gMo3LAf9TUXfjq9vqgzq97iD0kYVMCWmKc4G2tZbO4l2MHpAWCPc6hu7MFRHPSeSBwBwpEM+90uMkHXIVEwY0ohEkzyo8vgDowS1Lxfg2BDO/DMsf5SsHHkVmrgY+ONlb8uoZpojKFCG51oyBUOUMUEC+CXBw1z9ofr79aPeLRdBg6Y269tzmCmncW94oSKUUBhWhEno25TavjQddO8BwsurlZx/jTy4d4O91YbDGTZY/TaRRBsG9Ft/yhLFNlstplCDHp55mfZFKfA== X-MS-Exchange-AntiSpam-MessageData: zjFEuPYpXrP6ijMH4pYGaqoFvePF8/gJr7EwL9zh8910QmR8q8NfwxRjLZFvkxgMVvArMTm4rmSCFvNjcqG1noKD+dEPPyDIuE9F0ke/QEafVq+VJh2qEfvGlFj+f+o8dFWggg/FeveqGsJ6u8/YMw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f6d8fa9-d2fb-4b71-697c-08d8f074cf0b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 16:32:55.6157 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT013.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: VI1EUR04HT158 Received-SPF: pass client-ip=40.92.75.38; 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:128652 Archived-At: Stefan Monnier writes: >> No, no, I don't mean that some modes don't need undo. I mean, if I am >> working in a buffer, say some C file, and I think Emacs get sluggish, I >> could do some M-x clean-buffer and have it setq bunch of variables to >> nil, amongst them undo so GC can collect them. It is just that these >> variables might be different depending of type of buffer, active modes >> etc. > > I suspect that it would be "ineffective by design": It is inspired by 3D modelling/animation packages. They usually keep an undo stack of transformation matrices for models, materials etc. Since it quite fast becomes lots of data, they usually have something like "freeze transforms" or "clean scene" etc. One that I worked with used modified TCL interpretter with garbage collector to manage the scene graph, which is similar appliclation architecture to Emacs + Lisp. > in order to realize > that such-and-such setting might solve a performance problem, you'll > generally need first to be aware of that performance problem, and > usually once you're aware of it you can just fix the problem itself. Yes, that is why I ment a hook that will be avaialble for mode writers to put potential "cleanup" into since users probably don't know and should not need to know the details. I used undo history as example, but I ment bunch of other stuff. No idea how much it would give in practice though.