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

Martin Egholm Nielsen martin at egholm-nielsen.dk
Thu Mar 9 07:07:18 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);
	    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...

// Martin

More information about the Gc mailing list