two questions about GC module

Lee Dong Yul lomen at cselab.snu.ac.kr
Tue Sep 1 05:58:12 PDT 1998


I have used Kaffe 0.10.0 on linux Red Hat platform.

1.
-----------------------------------------------------------------------------
in mem/gc-incremental.c

 		finishGC();

                UNLOCK();

                if (flag_gc > 0) {
----->                fprintf(stderr, "<GC: heap %dK, total %dK, alloc
%dK, ma
rked %dK, freeing %dK>\n", gc_heap_total/1024, gcStats.totalmem/1024,
gcStats.al
locmem/1024, gcStats.markedmem/1024, (gcStats.totalmem >
gcStats.markedmem ? (gc
Stats.totalmem - gcStats.markedmem)/1024 : 0));
                }
                if (flag_gc > 1) {
                        OBJECTSTATSPRINT();
                }
-----------------------------------------------------------------------------

What is freeing item ( (gcStats.totalmem > gcStats.markedmem ?
(gcStats.totalmem - gcStats.markedmem)/1024 : 0))?

I don't know its use or its meaning...

What is the difference between Freeing item and Freed item?

2. Through some modifications of Kaffe 0.10.0 source, Run result
follows....

-----------------------------------------------------------------------------
[root:/usr/local/share/kaffe-0.10.0/kaffe/kaffe]./kaffe HelloWorldApp
mallopt disabled.
requiring memory...
gc_heap_total = 1MB, gc_heap_limit = 16MB.
after initBaseClasses
after initException
after initThreads
=========================================
Before GC
<GC: heap 1024K, total 861K, alloc 1247K>

After GC
<GC: heap 1024K, total 855K, marked 583K, freeing 272K, freed 5K>
=========================================
requiring memory...
gc_heap_total = 2MB, gc_heap_limit = 16MB.
Hello World!
Method Invocation Statistics
===============================================================
[java/lang/ThreadGroup    , add                      , 1, 1]
[java/lang/System         , initializeSystemClass    , 1, 2]
[java/util/Hashtable      , put                      , 19, 1]
[sun/io/CharToByte8859_1  , Constructor              , 2, 3]
[HelloWorldApp            , main                     , 1, 2]
===============================================================
[root:/usr/local/share/kaffe-0.10.0/kaffe/kaffe]
-----------------------------------------------------------------------------

In first GC, can alloc memory be greater than total memory?
I don't understand alloc memory value in my common sense....

About this two questions, Who can explain the cause to me?

Thanks.



More information about the kaffe mailing list