[Gc] 6.6 on Mac OS X 10.3.9

Boehm, Hans hans.boehm at hp.com
Mon Sep 19 12:47:42 PDT 2005


That might also be fairly easy to track down by placing breakpoints in
mmap and brk after it has run for a while.  Presumably one of those is
called regularly to allocate more memory from the OS.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Stephane Epardaud
> Sent: Monday, September 19, 2005 2:09 AM
> To: Cody Pisto
> Cc: gc at napali.hpl.hp.com; Andrew Begel
> Subject: Re: [Gc] 6.6 on Mac OS X 10.3.9
> 
> 
> 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/
> _______________________________________________
> 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