projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5428 from kumpera/wasm-support-p2
[mono.git]
/
mono
/
tests
/
sgen-bridge-major-fragmentation.cs
diff --git
a/mono/tests/sgen-bridge-major-fragmentation.cs
b/mono/tests/sgen-bridge-major-fragmentation.cs
index 5fc72e67e77bb713e73fc04ff27e723f28ea1eeb..c954ade20b8d539a9e221d41fa0036361391fcd2 100644
(file)
--- a/
mono/tests/sgen-bridge-major-fragmentation.cs
+++ b/
mono/tests/sgen-bridge-major-fragmentation.cs
@@
-13,6
+13,9
@@
public class Bridge {
}
class Driver {
}
class Driver {
+ static void LogLine (string message) {
+ Console.WriteLine ("[" + DateTime.Now + "] " + message);
+ }
//we fill 16Mb worth of stuff, eg, 256k objects
const int major_fill = 1024 * 256;
//we fill 16Mb worth of stuff, eg, 256k objects
const int major_fill = 1024 * 256;
@@
-24,7
+27,7
@@
class Driver {
for (int i = 0; i < major_fill; ++i)
arr [i] = new NonBridge ();
GC.Collect (1);
for (int i = 0; i < major_fill; ++i)
arr [i] = new NonBridge ();
GC.Collect (1);
-
Console.Write
Line ("major fill done");
+
Log
Line ("major fill done");
//induce massive fragmentation
for (int i = 0; i < major_fill; i += 4) {
//induce massive fragmentation
for (int i = 0; i < major_fill; i += 4) {
@@
-33,7
+36,7
@@
class Driver {
arr [i + 3] = null;
}
GC.Collect (1);
arr [i + 3] = null;
}
GC.Collect (1);
-
Console.Write
Line ("fragmentation done");
+
Log
Line ("fragmentation done");
//since 50% is garbage, do 2 fill passes
for (int j = 0; j < 2; ++j) {
//since 50% is garbage, do 2 fill passes
for (int j = 0; j < 2; ++j) {
@@
-44,7
+47,7
@@
class Driver {
arr [i] = new Bridge ();
}
}
arr [i] = new Bridge ();
}
}
-
Console.Write
Line ("done spewing bridges");
+
Log
Line ("done spewing bridges");
for (int i = 0; i < major_fill; ++i)
arr [i] = null;
for (int i = 0; i < major_fill; ++i)
arr [i] = null;
@@
-55,10
+58,10
@@
class Driver {
static void Main () {
const int loops = 4;
for (int i = 0; i < loops; ++i) {
static void Main () {
const int loops = 4;
for (int i = 0; i < loops; ++i) {
-
Console.WriteLine ("CrashLoop {0}/{1}", i + 1,
loops);
+
LogLine ("CrashLoop " + (i + 1) + "/" +
loops);
CrashMainLoop ();
}
CrashMainLoop ();
}
-
Console.Write
Line ("done");
+
Log
Line ("done");
GC.Collect ();
GC.WaitForPendingFinalizers ();
GC.Collect ();
GC.Collect ();
GC.WaitForPendingFinalizers ();
GC.Collect ();