From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#28590: Weak tables in 2.2.2 grow indefinitely Date: Tue, 07 Nov 2017 11:58:58 +0100 Message-ID: <874lq69wy5.fsf@gnu.org> References: <87poafkvsm.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1510052532 30990 195.159.176.226 (7 Nov 2017 11:02:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Nov 2017 11:02:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) To: 28590-done@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Nov 07 12:01:51 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC1dc-00074b-T2 for guile-bugs@m.gmane.org; Tue, 07 Nov 2017 12:01:49 +0100 Original-Received: from localhost ([::1]:52652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC1dk-0000FH-9w for guile-bugs@m.gmane.org; Tue, 07 Nov 2017 06:01:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC1c4-0007Yw-2R for bug-guile@gnu.org; Tue, 07 Nov 2017 06:00:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC1bu-0004F1-Pe for bug-guile@gnu.org; Tue, 07 Nov 2017 06:00:12 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eC1bu-0004Er-Lf for bug-guile@gnu.org; Tue, 07 Nov 2017 06:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eC1bu-0003ld-Ec for bug-guile@gnu.org; Tue, 07 Nov 2017 06:00:02 -0500 Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Tue, 07 Nov 2017 11:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 28590 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 28590@debbugs.gnu.org, ludo@gnu.org, ludo@gnu.org Original-Received: via spool by 28590-done@debbugs.gnu.org id=D28590.151005234114345 (code D ref 28590); Tue, 07 Nov 2017 11:00:02 +0000 Original-Received: (at 28590-done) by debbugs.gnu.org; 7 Nov 2017 10:59:01 +0000 Original-Received: from localhost ([127.0.0.1]:55233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC1av-0003jG-Bo for submit@debbugs.gnu.org; Tue, 07 Nov 2017 05:59:01 -0500 Original-Received: from hera.aquilenet.fr ([141.255.128.1]:37520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eC1at-0003j5-R7 for 28590-done@debbugs.gnu.org; Tue, 07 Nov 2017 05:59:00 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D4F54F6C1 for <28590-done@debbugs.gnu.org>; Tue, 7 Nov 2017 11:59:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Original-Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5B2ssMmNCBTv for <28590-done@debbugs.gnu.org>; Tue, 7 Nov 2017 11:59:00 +0100 (CET) Original-Received: from ribbon (unknown [193.50.110.150]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 15FB7F6B6 for <28590-done@debbugs.gnu.org>; Tue, 7 Nov 2017 11:59:00 +0100 (CET) In-Reply-To: <87poafkvsm.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 25 Sep 2017 10:49:13 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8880 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Consider this program: > > (use-modules (ice-9 format)) > > (define loops 3000000) > > (define table > (make-weak-key-hash-table)) > > (let loop ((i loops)) > (unless #f ;(zero? i) > (when (zero? (modulo i 100000)) > (format #t "heap-size: ~,2h MiB table: ~s~%" > (/ (assoc-ref (gc-stats) 'heap-size) (expt 2. 20)) > table)) > > (hashq-set! table (cons 1 2) #t) > (loop (1- i)))) > > On 2.0.14, the heap size stays at around 24=C2=A0MiB, and the table size = is > stable at 224,717 buckets (?). > > On 2.2.2, the heap grows indefinitely (though logarithmically). It=E2=80= =99s > not deterministic though: sometimes the heap size stabilizes in the > 140=E2=80=93300=C2=A0MiB range, and sometimes it keeps growing endlessly = even though > the table size reaches a maxium at 7,190,537 entries. This is fixed with Andy=E2=80=99s rewrite of weak tables to bucket-and-chai= ns as in 2.0: https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.2&id=3Da= 053c0510c4a644f9453166b7b385cf30f6d3a21 https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.2&id=3Dd= 01addeb1feba830ddd703e27f89576864a063ff https://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.2&id=3Dd= c8dda77e0c937abae42a76ea88c6e7995adbd9a https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00051.html \o/ Ludo=E2=80=99.