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:09:33 +0100 Message-ID: References: <87pmzmihyj.fsf@robertthorpeconsulting.com> <83lfaaot5h.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="6228"; 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:10:03 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 1lPo66-0001RE-Iy for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 16:10:02 +0100 Original-Received: from localhost ([::1]:57212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPo65-0007rd-9k for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 11:10:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPo5k-0007rL-Od for help-gnu-emacs@gnu.org; Fri, 26 Mar 2021 11:09:40 -0400 Original-Received: from mail-db8eur05olkn2090.outbound.protection.outlook.com ([40.92.89.90]:14910 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 1lPo5h-000236-VU; Fri, 26 Mar 2021 11:09:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nXGSBVCPac/0ZfdDZcyfL+N9KpuftCh7ALnzpQIAjLf6Stnb5QNcdJ4c+RH+HJKMC0XIj3F/WMv2dx5/NqkKAAdn0ri2RQLZymbZMxKh7a671DM2j6R6uGFdfsZikVYFeus3auic6FdKTiw452qhoCmyPKp8mVUcCIxaY8P1Ds9oVM7DLkVox7yNUme4fArQ9pPdRzFmyoxbUmznR/27eb9YTnxr2RWKJXyEVKQxzTyatD5LwwmstjmwqIVUx6Z4tMMFebulv5bL/PacKsqlgru11bk1DQ6FMXDZ31oyfuS/EiRIApmAr+M6oPhFUFLjGFqxgXRYLK3kO5CQSrtxKQ== 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=MPSkVP8gszwoc9Moz8/GpyUtv0K8JE2H6dD9kyzYlLQ=; b=nSMi63uoZajLSZtnDfDDiQv4mLIGKG15PqV7RCTL/TbUZb3ylA22vEQweR++Jchr1xOYgjPe/6fkPhMacTcWk1/jhVr7QJ3ihsVu15i6E66qx6QYfmWQT3/V+Tx/kBWzuaykh4S7+oUtzTLMVqx8cKxnInHfhTnzPOfRYfrXcpdDjtOmQOa8qxbA3rOED/1D3vdWDzuRbhW2EP4q03UbAK6FDzFpwVwCEnSELJBejfq/M+ySFXojskumdHYOso6COYLfW4xg1abFe1K8GJMsY8WwyOK+rd3hUbEZo9I2y56A5g5Piy6dTI5cxgBHTfa0697NyFWTM3ZUJcDLgZKsBQ== 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=MPSkVP8gszwoc9Moz8/GpyUtv0K8JE2H6dD9kyzYlLQ=; b=PHrdzXiAdiPoEAfE1nxKoTnpqtutch9q+mC6fcC4Y5NLBeWrzz7dKOoga6N1Wt1oBTkyZFy3JxRrgRF8u8AVjxZ7vqL7JXgwlid9LtJSzsNwgmQ48pItGdPHyllopln08FOWTrZ1gg5UfIodvlObIC8l202OFl3htIZZYq+L6Ncn+UtYqwQEHywto4wPlYJrxMHwchp2WKkdOka03mh5mH9elyxJ8Oq1BGrQvyuxrczK2qkGPE4Vm5WtJ04WN87cko6kiJ2FRvVcAs1bENNeQVH7slmVIygcjQuHUSReKYwAqpz35tBLN1N94rMIDyniKYOfXPxeU/8pi3f6VZ4gNg== Original-Received: from DB8EUR05FT067.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::40) by DB8EUR05HT096.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Fri, 26 Mar 2021 15:09:34 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc0f::42) by DB8EUR05FT067.mail.protection.outlook.com (2a01:111:e400:fc0f::176) 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:09:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:129D4E65D58C08A0BFDD01D4178E36C48CD3A2B12A8B771672C6E44974CE5DA4; UpperCasedChecksum:75A0621AEE3AED8103553763D252D75425FC4CD23ED8A499B216F5C51432DFD1; SizeAsReceived:7598; 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:09:34 +0000 In-Reply-To: <83lfaaot5h.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Mar 2021 18:02:02 +0300") X-TMN: [ksyKN7f79zkN16RAm6ahe+kGRRUVCxEn] X-ClientProxiedBy: AM5PR0701CA0011.eurprd07.prod.outlook.com (2603:10a6:203:51::21) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87k0pukl3m.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM5PR0701CA0011.eurprd07.prod.outlook.com (2603:10a6:203:51::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.17 via Frontend Transport; Fri, 26 Mar 2021 15:09:33 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 29c63e5b-545e-414e-13b3-08d8f06929ff X-MS-TrafficTypeDiagnostic: DB8EUR05HT096: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fz5y6ndDi4A+kgEfrcrEfhbS+TXqljJlYaAXd/rZBrfe5adt3spftrMgHGmAejwyhGtN7mE13pu4Ann2nsnkGyvea2x1y/2HBz0wVd/ThIwAyxuoFuIFlB9G8pPvyau5VheQBpXR0fuKvpq0ckk/xtI+4fkZeAYmW71qlni3pZmb0bjoaW/Xrx9JREQkurXC/v1IAVwLfcJ+DzfZhB61WPlwar0JbNOFl2R7Av24UdIHJEjG8ruEatI1cYYc9LxRP1cDa/PGKrtko8mN302DYLJ424D5I/itro3dVtQP+L/9nyYmM8nWTuD+OodkJdfSjFytrisn+2mWgQMHxRoj+0kEO/EYM9Nh9kVQUU8B8oDInZ47m2bJ+BHJ0Y41dkut0Xl5w2Vzfh1lYOerJyGS0w== X-MS-Exchange-AntiSpam-MessageData: FB28Rz1Gc1B1u8BXBreucOr0MVKf7OhYso2R/Prp7SpLh3szHpqKiHFHcUnbRA+bSXou4Opv9gh87y8Su32DYhZd47xFZiRY8KIoKYOrXgwcKBOCdVPCTZnUeAIarDG5rNKnjFSC+vvvIK0fWvpX2w== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29c63e5b-545e-414e-13b3-08d8f06929ff X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 15:09:34.2547 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT067.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: DB8EUR05HT096 Received-SPF: pass client-ip=40.92.89.90; 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:128638 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Date: Fri, 26 Mar 2021 15:57:09 +0100 >> Cc: help-gnu-emacs@gnu.org >> >> Would there be any way for Emacs to unload unused fonts? GC? > > We already do that. > >> 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. > > That's what GC does. Yes, but GC can't know if I don't need undo history, right, or old text in eshell buffer? 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?