Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sample.cs « size « samples - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e5da814435b2a725c7cda30dd61e445c0e0bb5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using Mono.ObjectServices;

class Demo {
    int a;
	static void Main ()
	{
		Demo d = new Demo ();

		prints ("d", d);
		prints ("dd", new DD ());
	}

	static void prints (string s, object x)
	{
		Console.WriteLine ("size of " + s + ":" + ObjectInspector.GetMemoryUsage (x));
	}
}

class DD {
    Demo d = new Demo ();
    object [] o = new object [10];
    
    public DD ()
    {
	    o [0] = new Demo ();
	    o [5] = new Demo ();
    }
}