From: ludo@gnu.org (Ludovic Courtès)
To: 28590@debbugs.gnu.org
Subject: bug#28590: Weak tables in 2.2.2 grow indefinitely
Date: Mon, 25 Sep 2017 10:49:13 +0200 [thread overview]
Message-ID: <87poafkvsm.fsf@gnu.org> (raw)
Consider this program:
--8<---------------cut here---------------start------------->8---
(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))))
--8<---------------cut here---------------end--------------->8---
On 2.0.14, the heap size stays at around 24 MiB, and the table size is
stable at 224,717 buckets (?).
On 2.2.2, the heap grows indefinitely (though logarithmically). It’s
not deterministic though: sometimes the heap size stabilizes in the
140–300 MiB range, and sometimes it keeps growing endlessly even though
the table size reaches a maxium at 7,190,537 entries.
Ludo’.
next reply other threads:[~2017-09-25 8:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 8:49 Ludovic Courtès [this message]
2017-09-26 9:57 ` bug#28590: Weak tables in 2.2.2 grow indefinitely Ludovic Courtès
2017-10-02 9:53 ` Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 0/7] Attempt to reduce memory growth Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 1/7] weak-table: Fix unbounded growth of the disappearing link table Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 2/7] weak-table: Stress the GC a little less when resizing Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 3/7] weak-table: Make sure 'move_disappearing_links' actually moves links Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 4/7] weak-table: Always unregister previous links when inserting an entry Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 5/7] weak-table: 'move_weak_entry' reports disappeared links Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 6/7] weak-table: 'rob_from_rich' accounts for disappeared entries Ludovic Courtès
2017-10-03 11:43 ` bug#28590: [PATCH 7/7] weak-table: Resize less frequently Ludovic Courtès
2017-10-04 13:09 ` bug#28590: [PATCH 0/7] Attempt to reduce memory growth Ludovic Courtès
2017-10-05 14:09 ` Ludovic Courtès
2017-11-07 10:58 ` bug#28590: Weak tables in 2.2.2 grow indefinitely Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87poafkvsm.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=28590@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).