[Gc] Large block uncollected ?

Nicolas Cannasse ncannasse at motion-twin.com
Tue Aug 12 09:12:41 PDT 2008


Henning Makholm a écrit :
>>> In this case you should try
>>> GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE instead.
>> Reading more about the subject in README, it seems that I can
>> also set :
>>
>> GC_all_interior_pointers = 0;
> 
> No - pointers found in stack and registers can always be interior,
> unless the object is expicitly allocated IGNORE_OFF_PAGE.

Using both (GC_all_interior_pointers = 0 + ignore_off_page allocations) 
does not seem to fix my problem.

Each thread can handle a request then returns to its waiting state, so 
no value used during the request should be reachable anymore.

However after several requests, and running a major collection, we can 
see that there is still something like 150MB of memory used (calculated 
with GC_get_heap_size() - GC_get_free_bytes()).

We then try restarting all the threads (sometimes several times) by 
having each thread spawn a clone before exiting, then running a major 
GC. After each of these restarts, the memory used drops until it reach 
2MB which should be the space used. The only trick I used is to fill 
10KB of the C stack with 0's when a thread starts, before using this stack.

Does anyone know a solution to this problem ? Restarting the threads 
more often would be too much costly, and filling the C stack with 0's 
after each request does not seem to work either.

Best,
Nicolas


More information about the Gc mailing list