[Gc] Re: Understanding why GC'ing increases to the double in time?

Martin Egholm Nielsen martin at egholm-nielsen.dk
Thu Mar 9 07:43:59 PST 2006


>>>> The collector is almost certainly spending it's time in mark_from.
>>>> It would be mildly useful to confirm that. It would be more useful
>>>> to confirm that this is not being called through the finalization
>>>> code.
>>
>> I reckon this still applies - I'll take a look into GC_mark_from in a 
>> minute and see if I can measure the time spent in there...
> For what it's worth, I put in time-measurements around the loop in 
> GC_stopped_mark that continuously invokes GC_mark_some:
> 
>   CLOCK_TYPE start_time2, current_time2; \
>   GET_TIME(start_time2); \
>     for(i = 0;;i++) {
>         if ((*stop_func)()) {
> #               ifdef CONDPRINT
>               if (GC_print_stats) {
>                 GC_printf0("Abandoned stopped marking after ");
>             GC_printf1("%lu iterations\n",
>                    (unsigned long)i);
>               }
> #            endif
>             GC_deficit = i; /* Give the mutator a chance. */
>                     IF_THREADS(GC_world_stopped = FALSE);
>                 START_WORLD();
>                 return(FALSE);
>         }
>         if (GC_mark_some((ptr_t)(&dummy))) break;
>     }
>   GET_TIME(current_time2); \
>   GC_printf1("MEN: for loop took: %lu msecs\n", 
> MS_TIME_DIFF(current_time2,start_time2)); \
> 
> And the time spent is indeed in that for-loop...

Even stranger (IMHO) - I added the "loop-length" to the final output, as 
well, and for the short-world-stop-situation it takes some 3042 loops to 
finish, and for the long-world-stop-situation its nearly the same: 3085.

I find it so very very strange?!

=== SHORT TIME ===
Initiating full world-stop collection 25 after 2831656 allocd bytes
0 bytes in heap blacklisted for interior pointers
--> Marking for collection 25 after 2831656 allocd bytes + 4352 wasted bytes
MEN: for loop took: 220 msecs, and took 3042 iterations
Collection 24 reclaimed 2787804 bytes ---> heapsize = 6075392 bytes
World-stopped marking took 230 msecs

=== LONG TIME ===
Initiating full world-stop collection 26 after 3319984 allocd bytes
0 bytes in heap blacklisted for interior pointers
--> Marking for collection 26 after 3319984 allocd bytes + 29600 wasted 
bytes
MEN: for loop took: 430 msecs, and took 3085 iterations
Collection 25 reclaimed 2994664 bytes ---> heapsize = 6075392 bytes
World-stopped marking took 430 msecs



More information about the Gc mailing list