[Gc] 6.6 on Mac OS X 10.3.9

Stephane Epardaud Stephane.Epardaud at sophia.inria.fr
Mon Sep 19 02:08:30 PDT 2005


Hi,

I was the one reporting the original problem.
Same here: it keeps growing, only your test case is not minimal: there is no
need to create any pthread in order to show the memory consumption growing: just
this:

int main(int argc, char **argv){
  GC_init();
  while(1){
    GC_malloc(1024);
  }
}

And that leaks. I left it there (sorry not to have followed through) due to lack
of time and unbearably painful and slow Mac machine access.

Cody Pisto wrote:
> The attached sample seems to reliably recreate the problem for me,
> 
> just build it with gcc -o testgc testgc.c -lgc
> 
> and run it from a terminal like so:
> 
> GC_DUMP_REGULARLY=1 ./testgc
> 
> Hope that helps,
> 
> -Cody
> 
> 
> Andrew Begel wrote:
> 
>> The output you show below looks legit to me. It looks like it's 
>> getting all your threads, right?
>>
>> At this point, we probably have to see your program. Got a small test 
>> case that someone else with a Mac can try?
>>
>> Andrew
>>
> 
> 
> ------------------------------------------------------------------------
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <pthread.h>
> 
> #define GC_THREADS
> #define GC_REDIRECT_TO_LOCAL
> #include "gc.h"
> #include "gc_local_alloc.h"
> 
> #define NR_THREADS 5
> 
> static void *
> handle_request (void *arg)
> {
>     void *test;
>     
>     for (;;)
>     {
>         test = GC_malloc(4096);
>         
>         sleep(30);
>         
>         test = NULL;
>         
>         GC_gcollect();
>     }
> }
> 
> 
> int
> main (int argc, char **argv)
> {
>     int i;
>     pthread_t threads[NR_THREADS];
> 
>     GC_INIT();
>     
>     /* spawn the processing threadpool */
>     for (i = 1; i < NR_THREADS; i++) {
>         pthread_create(&threads[i], NULL, handle_request, NULL);
>     }
> 
>     handle_request(NULL);
> 
>     exit(0);
>     return 0; /* not reached */
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/


More information about the Gc mailing list