Re[2]: [Gc] Re: [bigloo] Performance evaluation

Ivan Maidanski ivmai at mail.ru
Thu Aug 12 11:05:55 PDT 2010


Hello, Manuel!

1. It's better to send us a diff (not the whole patched file).

2. There is no need to patch GC for GC_get_allocated_bytes() as it always returns GC_get_total_bytes() - total_bytes_on_lastest_reset.

3. GC_composite_in_use and GC_atomic_in_use values are printed to log if GC_PRINT_STATS.

Regards.

Thu, 12 Aug 2010 05:58:48 +0200 Manuel.Serrano at sophia.inria.fr:

> > There are two things that worry me about this:
> > 
> > 1) The live data size seems to have increased.
> > 
> > 2) It seems to be collecting earlier, in spite of the larger heap.
> > 
> > You're using the collector without threads or incremental GC, right?
> We never use the collector in incremental mode and in that particular example
> we use it without threads (although in general, we do use it with threads).
> > 
> > How is the live size computed?
> The GC is slightly patched for adding some extra profiling information. To 
> compute the live size, we modify the function GC_finish_collection by adding 
> the following:
> 
>     if( GC_gcollect_hook )
>        GC_gcollect_hook( GC_heapsize,
> 			 (unsigned long)(GC_atomic_in_use)+
> 			 (unsigned long)(GC_composite_in_use) );
> 
> at the end of the function. Here is attached the whole modified alloc.c
> file.
> 
> ...
> /*---------------------------------------------------------------------*/
> /*    Bigloo profiling 13Apr2003: start                                */
> /*---------------------------------------------------------------------*/
> static void (*GC_gcollect_hook)() = 0;
> GC_add_gc_hook( void (*f)() ) {
>    GC_gcollect_hook = f;
> }
> /*---------------------------------------------------------------------*/
> /*    Bigloo profiling 13Apr2003: stop                                 */
> /*---------------------------------------------------------------------*/
> 
> /*---------------------------------------------------------------------*/
> /*    Bigloo start                                                     */
> /*---------------------------------------------------------------------*/
> static long allocated_bytes = 0;
> 
> GC_get_allocated_bytes() {
>    return allocated_bytes;
> }
> 
> void GC_reset_allocated_bytes() {
>    GC_gcollect();
>    allocated_bytes = 0;
> }
> 
> #ifdef KEEP_BACK_PTRS
> int GC_heap_info_available = 1;
> #else
> int GC_heap_info_available = 0;
> #endif
> /*---------------------------------------------------------------------*/
> /*    Bigloo stop                                                      */
> /*---------------------------------------------------------------------*/
>
> ....
> STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func)
> {
>     unsigned i;
>     int dummy;
> #   ifndef SMALL_CONFIG
>       CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
>       CLOCK_TYPE current_time;
> #   endif
> 
> #   if !defined(REDIRECT_MALLOC) && (defined(MSWIN32) || defined(MSWINCE))
>         GC_add_current_malloc_heap();
> #   endif
> #   if defined(REGISTER_LIBRARIES_EARLY)
>         GC_cond_register_dynamic_libraries();
> #   endif
> 
> /*---------------------------------------------------------------------*/
> /*    Bigloo start                                                     */
> /*---------------------------------------------------------------------*/
> #   ifdef KEEP_BACK_PTRS
>     allocated_bytes += GC_get_bytes_since_gc();
> #   endif
> /*---------------------------------------------------------------------*/
> /*    Bigloo stop                                                      */
> /*---------------------------------------------------------------------*/
> ....
> 
> /*---------------------------------------------------------------------*/
> /*    Bigloo profiling 13Apr2003: start                                */
> /*---------------------------------------------------------------------*/
>     if( GC_gcollect_hook )
>        GC_gcollect_hook( GC_heapsize,
> 			 (unsigned long)(GC_atomic_in_use)+
> 			 (unsigned long)(GC_composite_in_use) );
> /*---------------------------------------------------------------------*/
> /*    Bigloo profiling 13Apr2003: start                                */
> /*---------------------------------------------------------------------*/
>   
>     /* Reset or increment counters for next cycle */
>       GC_n_attempts = 0;
>       GC_is_full_gc = FALSE;
>       GC_bytes_allocd_before_gc += GC_bytes_allocd;
>       GC_non_gc_bytes_at_gc = GC_non_gc_bytes;
>       GC_bytes_allocd = 0;
>       GC_bytes_dropped = 0;
>       GC_bytes_freed = 0;
>       GC_finalizer_bytes_freed = 0;
> 
> #   ifdef USE_MUNMAP
>       GC_unmap_old();
> #   endif
> ...



More information about the Gc mailing list