コード例 #1
0
        public static int Main(String [] args)
        {
            Node longLivedTree;
            Node tempTree;

            Console.WriteLine("Test should return with ExitCode 100 ...");

            GCBench Mv_Obj = new GCBench();

            // Stretch the memory space quickly
            tempTree = MakeTree(kStretchTreeDepth);
            tempTree = null;

            // Create a long lived object
            longLivedTree = new Node();
            Populate(kLongLivedTreeDepth, longLivedTree);

            // Create long-lived array, filling half of it
            double [] array = new double[kArraySize];
            for (int i = 0; i < kArraySize / 2; ++i)
            {
                array[i] = 1.0 / i;
            }

            GC.Collect();

            for (int d = kMinTreeDepth; d <= kMaxTreeDepth; d += 2)
            {
                Mv_Obj.TimeConstruction(d);
            }

            Console.WriteLine("Test Passed");
            return(100);
        }
コード例 #2
0
ファイル: gcbench.cs プロジェクト: CheneyWu/coreclr
        public static int Main(String [] args)
        {
            Node    longLivedTree;
            Node    tempTree;

            Console.WriteLine("Test should return with ExitCode 100 ...");

            GCBench Mv_Obj = new GCBench();

            // Stretch the memory space quickly
            tempTree = MakeTree(kStretchTreeDepth);
            tempTree = null;

            // Create a long lived object
            longLivedTree = new Node();
            Populate(kLongLivedTreeDepth, longLivedTree);

            // Create long-lived array, filling half of it
            double []array = new double[kArraySize];
            for (int i = 0; i < kArraySize/2; ++i)
            {
                array[i] = 1.0/i;
            }

            GC.Collect();

            for (int d = kMinTreeDepth; d <= kMaxTreeDepth; d += 2)
            {
                Mv_Obj.TimeConstruction(d);
            }

            Console.WriteLine("Test Passed");
            return 100;
        }