]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/new-largeish-contiguous-array-with-size.js
1 // We only need one run of this with any GC or JIT strategy. This test is not particularly fast.
2 // Unfortunately, it needs to run for a while to test the thing it's testing.
4 //@ runWithRAMSize(10000000)
13 var result
= foo(size
);
14 if (result
.length
!= size
)
15 throw "Error: bad result: " + result
;
16 var sawThings
= false;
20 throw "Error: array is in bad state: " + result
;
22 if (result
[0] != "42.5")
23 throw "Error: array is in weird state: " + result
;
26 var result
= gcHeapSize();
28 for (var i
= 0; i
< 1000; ++i
) {
29 // The test was written when we found that large array allocations weren't being accounted for
30 // in that part of the GC's accounting that determined the GC trigger. Consequently, the GC
31 // would run too infrequently in this loop and we would use an absurd amount of memory when this
36 // Last time I tested, the heap should be 3725734 before and 125782 after. I don't want to enforce
37 // exactly that. If you regress the accounting code, the GC heap size at this point will be much
39 var result
= gcHeapSize();
40 if (result
> 10000000)
41 throw "Error: heap too big before forced GC: " + result
;
43 // Do a final check after GC, just for sanity.
45 result
= gcHeapSize();
47 throw "Error: heap too big after forced GC: " + result
;