| // We only need one run of this with any GC or JIT strategy. This test is not particularly fast. |
| // Unfortunately, it needs to run for a while to test the thing it's testing. |
| //@ if $architecture =~ /arm|mips/ then skip else runWithRAMSize(10000000) end |
| if (result.length != size) |
| throw "Error: bad result: " + result; |
| throw "Error: array is in bad state: " + result; |
| throw "Error: array is in weird state: " + result; |
| var result = gcHeapSize(); |
| for (var i = 0; i < 1000; ++i) { |
| // The test was written when we found that large array allocations weren't being accounted for |
| // in that part of the GC's accounting that determined the GC trigger. Consequently, the GC |
| // would run too infrequently in this loop and we would use an absurd amount of memory when this |
| // Last time I tested, the heap should be 3725734 before and 125782 after. I don't want to enforce |
| // exactly that. If you regress the accounting code, the GC heap size at this point will be much |
| var result = gcHeapSize(); |
| throw "Error: heap too big before forced GC: " + result; |
| // Do a final check after GC, just for sanity. |
| throw "Error: heap too big after forced GC: " + result; |