Main Site Documentation

Strange debugger message


#1

Hi FEZ Gurus,

I’ve finally build my 1st shield to start playing with the Pololu RRC04 I’ve got for Xmas, along with a TB6612 (dual motor driver) and QTR-8A (analog output reflector sensor array)

I am now experimenting with the QTR-8A with a basic loop to read the analog data and display on debug console :

while (Misc.Key1.Read())
            {
                int[] values = qtr.ReadAnalog();
                String str = "! ";
                foreach (int a in values)
                    str += a.ToString() + " ! ";
                Debug.Print(str);
                Thread.Sleep(1000);
            }

(this is just to give an idea of my code, the qtr class encapsulate 5 AnalogIn pins and the ReadAnalog returns an array of the values)

But every minute or so, I got the following message :

GC: 3msec 14256 bytes used, 50124 bytes available
Type 0F (STRING              ):    144 bytes
Type 11 (CLASS               ):   1632 bytes
Type 12 (VALUETYPE           ):     36 bytes
Type 13 (SZARRAY             ):    360 bytes
Type 15 (FREEBLOCK           ):  50124 bytes
Type 17 (ASSEMBLY            ):   9336 bytes
Type 18 (WEAKCLASS           ):     48 bytes
Type 19 (REFLECTION          ):     24 bytes
Type 1B (DELEGATE_HEAD       ):    144 bytes
Type 1D (OBJECT_TO_EVENT     ):    120 bytes
Type 1E (BINARY_BLOB_HEAD    ):    192 bytes
Type 1F (THREAD              ):    384 bytes
Type 20 (SUBTHREAD           ):     48 bytes
Type 21 (STACK_FRAME         ):    636 bytes
Type 27 (FINALIZER_HEAD      ):    240 bytes
Type 31 (IO_PORT             ):    180 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):    660 bytes

I’ve no idea what it means.
Does not looks like a stack dump.
I have never saw such message before in native NET coding on PC.

So what doctor ?
Do I have a crappy code to debug ?

Thanks


#2

Thats the GC (Garbage Collector) freeing up resources.


#3

Thanks.

So if garbage are collected so often, I do have a crappy code throwing memory away …

Or does it occurs on regular base whatever I do ?


#4

You can turn teh messages iff if they freak you out, but there’s no problem; GC is a normal process that you should not be scared of. From memory it’s debug.gc(false) or something to turn messages off

What you should be scared of is when the number of bytes in the first line changes significantly over time, that means you’re leaking memory, so the message becomes very helpful then !