From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aRvIH2rChWRQtQAASxT56A (envelope-from ) for ; Sun, 11 Jun 2023 14:47:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iDR/HmrChWRhgAAA9RJhRA (envelope-from ) for ; Sun, 11 Jun 2023 14:47:38 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C6F82CD2F for ; Sun, 11 Jun 2023 14:47:38 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8KT3-0000hN-8e; Sun, 11 Jun 2023 08:46:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8KSz-0000h1-W8 for emacs-orgmode@gnu.org; Sun, 11 Jun 2023 08:46:46 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8KSw-000304-RT for emacs-orgmode@gnu.org; Sun, 11 Jun 2023 08:46:44 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 82C34240101 for ; Sun, 11 Jun 2023 14:46:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1686487600; bh=uX1H7xMyzKG2uozNGsPgYcM76hNfnqEOoGmdKPXoM3A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=GBcMWytUS5pXl7a+h/Ryu4yggWUFBArxH/mvBaX8VEtGP4lH5yH9D7q/Q4NfJZf0R jexCIPHtxwVX0SS9SV5BcCPCkU52uWXZPGjiN0G3xKMQPGJ5KWAueiaTYY4iLa2v7M 4ahovjDMy7/6ncYTguhROdFUOr8OIJEUnzaOW34RxOarvx+eH8+b0MepuCwwcQTEC9 6lWVuaLSBu5ZSHcmJREa+8keadOAa+1R2v0bvWG3FFseSatZtJztYYE+RlMkbdiumi lWgCKdhQigSnbVRXnPaDS8zORG/VkV4kvkHK4hWuEpd8yxDiqc7wmofzq2HqbgEiJk 15O/OXcAfIzCQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QfF1q6yYSz6trs; Sun, 11 Jun 2023 14:46:39 +0200 (CEST) From: Ihor Radchenko To: Sebastian =?utf-8?Q?W=C3=A5linder?= Cc: emacs-orgmode@gnu.org Subject: Re: Org element cache in indirect buffers In-Reply-To: <87o7lmb3ih.fsf@nixos.mail-host-address-is-not-set> References: <87o7lmb3ih.fsf@nixos.mail-host-address-is-not-set> Date: Sun, 11 Jun 2023 12:51:29 +0000 Message-ID: <87v8funovi.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686487658; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=uX1H7xMyzKG2uozNGsPgYcM76hNfnqEOoGmdKPXoM3A=; b=dlk2uX1W/esyceVmFjcFULmx4fNFM6TM8m9+eUX9cSS8X955grQBZldqwpddzb1nrZ+pnQ 7Woe3xzkuRfB5Ti84jNxrZTmxRE6SfhL+HwLelfC/iRwgAF20rDpJiGyUlvKQdqe6nWiik co/XpD97xZokhZcSFTtajsvreGdHI83VfpOw495L2Ywih8BOnA5reuapFaeHdpU6IPPEEh 9f1KHnY9jDmyCII0yEzGnRDCsQV4oieLMsVYGQ6VTKKDGKjMv3kzm98q3myItvaptm1E68 nOYlMjvRMOLyLQKRnDtLXtHp2EzbrwpOA3eO2+NugtGaw9Z+PQPx3H0WgFBq+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GBcMWytU; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686487658; a=rsa-sha256; cv=none; b=OWi+xDLvD9u1H2YJJi066TsIWRktnvu3rpCW0x3tdMOVjMTO5W93hTnSosJkJNqtCWa1t7 SPbed4X0Ug82ChE3b9Du+46TLBMdLu41F9csHuvfiYC28tR3AO3uJjoFNRKURAXBgN04Qt x1IPYmiASW+RmXUmgtYQZb64DKM9DYlfcO2kpmZVvxXHtE3QvufqVw8vkDm5gj2w8hNjo1 pNTP68UTDkVldcAT06kxpypYKOfinLQIgIvVinT17evjoTlMJSQVqRki1NQmQJlhHxcqx1 LBgH7tgbO5m2zOzdgw2vNBtg9id8zLaH6Kcqxhi3YRofsgJqVFG1ORa6BMdwKA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.18 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GBcMWytU; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1C6F82CD2F X-Spam-Score: -6.18 X-TUID: cJnAXkjNB75k Sebastian W=C3=A5linder writes: > It appears that indirect buffers duplicate the entire org element cache f= rom the base buffer whenever created. Not exactly. Only link to the cache root is copied and some cache elements may not be garbage-collected. > Running `memory-report` indicates that each indirect buffer has the same = memory blueprint. > This becomes a massive issue with large org files. > > My in my 160 000 line org file, the org element cache takes 100 mb, and s= o each new indirect buffer consumes an additional 100 mbs of memory. This has to be a bug in `memory-report'. Most of the cache elements will be referenced by link and thus there should be double-counting going on som= ewhere. > I also wonder if this means the caching is performed by each indirect buf= fer independently, and doesn't carry over. Caching is using base buffer actually. I guess we can explicitly set reference to the cache root to nil in indirect buffers. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at