4 Bug 1067491 - Test forcing a gc.
8 <title>Memory monitoring actor test
</title>
9 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css">
14 <script src=
"memory-helpers.js" type=
"application/javascript"></script>
18 window
.onload = function() {
19 SimpleTest
.waitForExplicitFinish();
22 const { memory
, target
} = await
startServerAndGetSelectedTabMemory();
24 let beforeGC
, afterGC
;
28 for (let i
= 0; i
< 1000; i
++) {
35 beforeGC
= (await memory
.measure()).total
;
37 await memory
.forceGarbageCollection();
39 afterGC
= (await memory
.measure()).total
;
40 } while (beforeGC
< afterGC
);
42 ok(true, "The amount of memory after GC should eventually decrease");
44 destroyServerAndFinish(target
);