I came across very strange behavior. With this dummy code:
static void Main( string[] args ) { int i = 0; while ( true ) { i++; String giro = "iteration " + i; Console.WriteLine(giro); Thread.Sleep(40); } }
Using perfom, private bytes are incremented.
img http://dl.dropbox.com/u/2478017/memory.gif
How is this possible?
I thought the GC takes care of these things.
In addition, if I compare the behavior of the memory with the version in which I forcefully collect the GC collection every 10 iterations, the result (for me) is surprising:

The green process is one that does not have GC.COllect (), and the black is different.
Could you help me understand the problem?
Thanks!
source share