[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28590: Weak tables in 2.2.2 grow indefinitely
From: |
Ludovic Courtès |
Subject: |
bug#28590: Weak tables in 2.2.2 grow indefinitely |
Date: |
Mon, 02 Oct 2017 11:53:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
address@hidden (Ludovic Courtès) skribis:
> 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.
Below is a simple reproducer in C that I’ve also reported at
<https://github.com/ivmai/bdwgc/issues/182>:
--8<---------------cut here---------------start------------->8---
#define GC_DEBUG 1
#include <gc.h>
#include <stdlib.h>
#include <stdio.h>
int
main ()
{
GC_INIT ();
while (1)
{
unsigned int count = 777 * (random () % 1000);
void **p = GC_MALLOC_ATOMIC (count * sizeof *p);
for (unsigned int i = 0; i < count; i++)
{
void *key = GC_MALLOC_ATOMIC (10);
p[i] = key;
GC_GENERAL_REGISTER_DISAPPEARING_LINK (&p[i], key); /* <- !!! */
}
static unsigned int loops = 0;
if (loops++ % 10 == 0)
printf ("iteration %4u, heap size = %li MiB\n",
loops, GC_get_heap_size () / (1024 * 1024));
}
}
--8<---------------cut here---------------end--------------->8---
Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#28590: Weak tables in 2.2.2 grow indefinitely,
Ludovic Courtès <=