2 "This test checks whether the GC collects after string appends."
5 // FIXME: This test appears to be highly tied to the details of how JS strings report memory
6 // cost to the garbage collector. It should be improved to be less tied to these implementation details.
7 // <https://bugs.webkit.org/show_bug.cgi?id=20871>
10 testRunner.dumpAsText();
12 if (window.GCController)
13 GCController.collect();
16 // str has 150 chars in it (which is greater than the limit of the GC to ignore which I believe is at 128).
17 var str = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
19 for (var i = 0; i < count; ++i) {
23 // str has 128 chars in it.
24 str = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
26 for (var i = 0; i < count; ++i) {
31 if (window.GCController)
32 jsObjCount = GCController.getJSObjectCount();
34 if (jsObjCount <= 500 && jsObjCount > 0)
35 testPassed("Garbage Collector triggered")
37 testFailed("Garbage Collector NOT triggered. Number of JSObjects: " + jsObjCount);