|
![](/i/fill.gif) |
Before running: 6.8 meg of unshared memory used.
While running: 7.1 meg of unshared memory used.
Doesn't look like GC tends to expand indefinitely, even when you *do* have
tons of memory available. If you use allocations bigger than about 80K, it
works even better, because .NET tracks them separately in a separate
generation.
(Patched into a larger program just to test it out, so it's not 6 meg for
this simple bit of code.)
private void button6_Click(object sender, EventArgs e)
{
byte[] outer; byte[] outer2;
for (int i = 0; i < 1024 * 1024 * 200; i++)
{
outer = new byte[8192];
byte[] inner1 = new byte[8192];
byte[] inner2 = new byte[50190];
for (int j = 0; j < 1024; j++)
{
outer2 = new byte[30000];
}
}
}
--
Darren New, San Diego CA, USA (PST)
"Ouch ouch ouch!"
"What's wrong? Noodles too hot?"
"No, I have Chopstick Tunnel Syndrome."
Post a reply to this message
|
![](/i/fill.gif) |