From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Configure GMP to use GC allocation functions, remove bignum finalizers Date: Sun, 27 Nov 2011 22:25:50 +0100 Message-ID: <8762i5mf4x.fsf@gnu.org> References: <87tycaodlk.fsf@netris.org> <87k4d6edvr.fsf@gnu.org> <8739jue9wk.fsf@neil-laptop.ossau.uklinux.net> <87zkfh9x8r.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1322429166 21577 80.91.229.12 (27 Nov 2011 21:26:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 27 Nov 2011 21:26:06 +0000 (UTC) Cc: guile-devel@gnu.org, Neil Jerram To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Nov 27 22:26:01 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RUmEb-0005Hn-7y for guile-devel@m.gmane.org; Sun, 27 Nov 2011 22:26:01 +0100 Original-Received: from localhost ([::1]:54833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUmEa-00032E-Cm for guile-devel@m.gmane.org; Sun, 27 Nov 2011 16:26:00 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUmEY-000326-95 for guile-devel@gnu.org; Sun, 27 Nov 2011 16:25:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUmEW-0000zC-M7 for guile-devel@gnu.org; Sun, 27 Nov 2011 16:25:58 -0500 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:53712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUmEW-0000yr-9u for guile-devel@gnu.org; Sun, 27 Nov 2011 16:25:56 -0500 X-IronPort-AV: E=Sophos;i="4.69,579,1315173600"; d="scan'208";a="132867667" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 27 Nov 2011 22:25:54 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Frimaire an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87zkfh9x8r.fsf@pobox.com> (Andy Wingo's message of "Sun, 27 Nov 2011 20:33:08 +0100") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.82 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12937 Archived-At: Hi! Andy Wingo skribis: > I still this this is a good idea. The key would be to GC more often > when the heap image grows faster than GC'd memory is allocated. We can > detect this situation by computing (ImageSize_t+1 - ImageSize_t) / > (LiveBytes_t+1 - LiveBytes_t), where ImageSize is some measure of the > total process size, perhaps via getrusage(), and LiveBytes is > GC_get_heap_size() - GC_get_free_bytes(). The problem is that this measurement doesn=E2=80=99t allow us to differenti= ate between a growing heap with objects that may be freed as a result of running the GC, and a growing heap just because the application needs more malloc=E2=80=99d objects. (I think this is the argument that was made against my __malloc_hook patch back then. [0]) A longer term option may be to augment libgc with something akin to our old scm_gc_register_collectable_memory. WDYT? Thanks, Ludo=E2=80=99. [0] http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehm= gc/4371