Main Site Documentation

Garbage Collect messages (GC) spamming my Debug screen


#1

Anyone got a quick tip and how to shut up the GC dumps to the debug screen?

There’s a couple places in code where the GC just goes berzerk and spams the debug screen constantly. Makes it so you can’t see anything else…

Visual Studio 2010 Professional. Using FEZ Domino over USBizi.
COM Port Shield attached.
Application: High Altitude Balloon Project - code uses a threaded / event / delegate model for communications over COM1. Works great, but then seems to lose track of the commands I’m sending and it goes into GC spam dump mode.

Thanks


#2

What about:


Debug.EnableGCMessages(false);


#3

But keep in mind that these messages mean the GC is working hard… Maybe too hard. Have a good look at making your variable declaration more efficient.

I’m going to guess you’re using the new keyword in a loop maybe even to create new arrays. That is a GC berzerkerizer.


#4

@ Dejan: Just what I was looking for, thanks!
@ Realizer: as I was trying to sleep last night, I thought I was being a bit too adventuresome with one part of the main command loop - where I place all incomming commands into a circular buffer (using an ArrayList) and popping them out one at a time as they’re processed. Will remove that later today when I get a chance to fire everything up again. ;D

Thanks gents