views:

62

answers:

1

Trying to find some information on the GC. In my log i see these entrie often:

08-19 22:35:27.513: DEBUG/dalvikvm(1981): GC_EXPLICIT freed 93 objects / 3160 bytes in 999ms
08-19 22:35:28.256: DEBUG/dalvikvm(2331): GC_FOR_MALLOC freed 15082 objects / 523496 bytes in 47ms

whats the difference between the 2?

A: 

When you call System.gc(), a GC_EXPLICIT garbage collection will happen some time in the future. Malloc is a C term and function for allocating memory. A GC for malloced memory will be the system cleaning up your dead java variables because they are no longer in use. (This is done automatically as needed).

Moncader
Put another way, GC_FOR_MALLOC happens "naturally" as part of allocating memory. GC_EXPLICIT means somebody deliberately forced a GC to happen.
fadden