P
Peter
I'm try to check how CG free up memory in intesive
allocation situation. But it seems that after an
collection, the memory is a bit larger than last time.
For example, from I run the code below for 100,000 cycle
after the first collection the size is '28,228'
after the last collection the size is '149,880'
This continue increase of memory worries me.
Do you know why this happens?
Thanks.
// The main flow ... ---------------------------
for(int i=0; i<100000; i++)
{
cv = new CV( 1024 );
cv = null;
Console.WriteLine( System.GC.GetTotalMemory(false ) );
}
// CV is defined as ... -----------------------
class CV
{
public CV( int n )
{
list = new byte[n];
}
public byte[] list;
}
allocation situation. But it seems that after an
collection, the memory is a bit larger than last time.
For example, from I run the code below for 100,000 cycle
after the first collection the size is '28,228'
after the last collection the size is '149,880'
This continue increase of memory worries me.
Do you know why this happens?
Thanks.
// The main flow ... ---------------------------
for(int i=0; i<100000; i++)
{
cv = new CV( 1024 );
cv = null;
Console.WriteLine( System.GC.GetTotalMemory(false ) );
}
// CV is defined as ... -----------------------
class CV
{
public CV( int n )
{
list = new byte[n];
}
public byte[] list;
}