POV-Ray : Newsgroups : povray.off-topic : Interesting GC performance test : Re: Interesting GC performance test Server Time
6 Sep 2024 07:18:55 EDT (-0400)
  Re: Interesting GC performance test  
From: Warp
Date: 31 Jan 2009 18:07:52
Message: <4984d9c8@news.povray.org>
Darren New <dne### [at] sanrrcom> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.