summaryrefslogtreecommitdiff
path: root/tests/src/GC/Performance/Tests/GCSmall.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/GC/Performance/Tests/GCSmall.cs')
-rw-r--r--tests/src/GC/Performance/Tests/GCSmall.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/src/GC/Performance/Tests/GCSmall.cs b/tests/src/GC/Performance/Tests/GCSmall.cs
new file mode 100644
index 0000000000..e9c452bb35
--- /dev/null
+++ b/tests/src/GC/Performance/Tests/GCSmall.cs
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+internal class GCSmall
+{
+ internal int i;
+ internal int j;
+
+ public static void Main(string[] p_args)
+ {
+ long iterations = 200;
+ GCSmall ns = new GCSmall();
+
+ for (long i = 0; i < iterations; i++)
+ {
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ ns = new GCSmall();
+ }
+
+ if(ns == null)
+ Console.WriteLine("Shouldn't get here");
+
+ GC.KeepAlive(ns);
+ }
+}