From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Opportunistic GC Date: Mon, 8 Mar 2021 12:37:21 +0100 Message-ID: References: <666da624-2f59-2eb4-8e56-f0ad20dd900c@gmx.at> <26ff7447-9c29-a2f2-bf3d-9eac20a95d0f@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21236"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 08 12:38:21 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lJEDN-0005RB-Dw for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 12:38:21 +0100 Original-Received: from localhost ([::1]:42388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJEDM-0003Mi-Fd for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 06:38:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJECa-0002iS-Pg for emacs-devel@gnu.org; Mon, 08 Mar 2021 06:37:33 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:38203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJECX-00036N-7a; Mon, 08 Mar 2021 06:37:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1615203443; bh=gBejpGoJDKFssU+/VUsWnDfEaO3gcQq65TVxqDiXpAc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Ib/DJtQkWOWjJCBHFK2h+qsILiXLH+Vke7evgmee3Jsrp/tSW7WUFjy7vYziQpqO+ 2+pSeIMF4nVlbYAOLJ5vwus6qfGRkbF8lii8wUhIahy9cjMCsNNhOoY/rVH62G5Aqf gokKSzBppkiqzL4AmNNnTiEnO1qHMaE3QmY054o8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.150]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MG9g4-1lXZ8A3JCW-00GZlU; Mon, 08 Mar 2021 12:37:22 +0100 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:MQOsd+jpAtb9GghRFI6pgKAneUCk1GyTWkbdRiQjpiUAfbcJeac e83FIDvKhgIZYwphgsN88ptt7blW+elhlNw6p1n6qRbfhOmd2+qfrDxfpYeEhL4H7pxVwsQ sedmeTgq7n1KXUKwNUQkhmXcVcUN6XY+Ws8+1D75dAptOjfRHYZFOsfYXmdkk1nvqEP+9p6 4/tpz3yGESazAU/9qeLyA== X-UI-Out-Filterresults: notjunk:1;V03:K0:zR9rc58aDas=:S9teXzQXoOy4R/S/zBnROU wk1gg6V3Xx//0VbF8k5chALZ4t7nCv8K/MJ6dp1e9R6EwJ0TogtGdke6oSDu3nR5kfJDXYLhC XTNpWban9FnO3/utzxchNyS+0mRc29PRLggbMNhRwHgSbPS7Umva8yPtvlO93Z3TXsGPS6Zkf igposZsM5knkPPf1lRxBB5HsWWSi1VEhaotDJFSG0xqykLyPAw/cl+CLmkQL/0Kejr/FSWLRh qkAPfDALn5TdkTjMPmZBoGEMR4g+m2LpBwkpC0aBgM9OpL11reJ6rYGDM1RHm0Mdwz0yQtGNq 0qabbwSaP2JfL5CmmZdQFrO3Ilc2X2QyUrLbn0fNB1XqWxRGlA/LDXto1WPAytB2rsPtAwHNt OnoTWm33BZnhy/PIyrFxibds4s8DVLhqdqXodHjykuuptLcJ0cHXBlzKRJ/YOhE8aH6ByJG3q qRPtGF96KDM8kBoIEako1PBb+EPkKzA5pwvM7o+7IK3AVHW0dA/IBw7yYQdIcnLaXbrfO1ax5 A7wjQf690CUTKtzn1ZNeL//Pud6qoVaybKotc+hMpTnFOt0QzkMu07qMnQo1Hz20nSSXgvlzW r7qMJkmEM3KNsgO6Utu3ZHufFXQtWpApXkGJFOAnSAJ65lYWaJbZkDjdoDSyah8KjqakF2o0r 7umIFbNclxTA6u1DmWIP/0c0qqv6XeF2PX1+xgNutNarfJ6gOy6XnneJbCXhOV/8Qic0giw+l 4FO2kPs2CPurjze5tMcZDod0GRGo2OZUSq4nNS2cW4yST+Kn8aIXVb5GP709jEqv+9Qt9vif Received-SPF: pass client-ip=212.227.17.20; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266173 Archived-At: >> And short-lived objects have to >> wait for the next cycle to get recovered. > > I'm not aware of any GC algorithm that recovers objects allocated > after the GC cycle started :-) In the early phase of a collection cycle most objects are unmarked so it would make sense to give a new object the mark status of the first object referencing it. But that's admittedly hard to do with ambiguous roots. > Mostly that there should not be a doubling of memory usage. With the > mark bits fixed, memory usage would grow by, at most, 1/64th the heap > size on 64-bit systems, plus a constant. I think we can live with a > 1.5% increase in memory usage if we get (effectively) zero-cost (or > zero latency) GC in exchange. (I'm assuming there'll be an unused CPU > core, which is usually true for me (unless I'm compiling something)). > With the mark bits not fixed, memory usage would increase by > approximately the size of the surviving heap, but not the size of the > discarded heap pages. But doesn't that depend on how many writes the Lisp thread performs in the heap? Each such write causes its associated page getting written out to avoid that an old link gets lost. And if the action was to drop an old link, writing the page out doesn't even make sense. > Note that none of this is "real" GC: we still mark and sweep, just in > a slightly smarter way. If with "real" you meant "real-time", then it might qualify as such. martin