|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> 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];
> }
> }
> }
Are you sure the compiler is not performing some clever optimization
tricks there like: "Hmm, this code allocates a piece of memory to this
pointer, the pointer demonstrably is not passed to anything anywhere
but is re-assigned a new memory block, thus the allocated memory is
likewise freed at that point, so I'll put a GC flag to this block of
memory to tell the GC engine that it's free."
I wonder if it makes any difference if the pointer is passed to some
function which the compiler doesn't know what it does at this point.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |