[Mono-list] Unable to create more than 1000 objects.

Dragony cschmid at rapidshare.com
Fri Dec 16 18:19:07 EST 2011


Another sgen-benchmark. The fast run takes 13 seconds, the slow run takes 6
minutes(!). Same result, same memory consumption. I don't think its
impossible to adjust sgen and to make it work like a charm.

WARNING: Test run requires 20 GB of Ram, unless you adjust the values.

using System;

class Test {
// fast
  public static int blocks = 1000;
  public static int unitsPerBlock = 1000000;

// slow
//  public static int blocks = 1000000;
//  public static int unitsPerBlock = 1000;

  public static Unit[][] units = new Unit[blocks][];

  static public void Main () {
    for (int i = 0; i < blocks; i++) {
      units[i] = new Unit[unitsPerBlock];
      for (int u = 0; u < unitsPerBlock; u++) units[i][u].val1 = 123;
      if (i % (blocks/100) == 0)
Console.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") + "> " + (i+1) + "
blocks need " + (GC.GetTotalMemory(false) /
    }
  }
}
  
struct Unit {
  public int val1;
  public int val2;
  public int val3;
  public int val4;
  public int val5;
}


--
View this message in context: http://mono.1490590.n4.nabble.com/Unable-to-create-more-than-1000-objects-tp4184397p4206704.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list