| Index: runtime/observatory/tests/service/get_isolate_after_out_of_memory_error_test.dart
|
| diff --git a/runtime/observatory/tests/service/get_isolate_after_out_of_memory_error_test.dart b/runtime/observatory/tests/service/get_isolate_after_out_of_memory_error_test.dart
|
| index 24bb08319dd72a024127d04f15970d5bd482e443..2cdf4a0a81dc93542970787f0e80f66c92f42254 100644
|
| --- a/runtime/observatory/tests/service/get_isolate_after_out_of_memory_error_test.dart
|
| +++ b/runtime/observatory/tests/service/get_isolate_after_out_of_memory_error_test.dart
|
| @@ -10,7 +10,18 @@ import 'service_test_common.dart';
|
| import 'dart:math';
|
|
|
| void goOutOfMemory() {
|
| - new List(pow(2, 53));
|
| + // Trying to allocate an array larger than Array::kMaxElements
|
| + // results in a RangeError instead of an OutOfMemoryError.
|
| + // To always obtain an OutOfMemoryError we create more than one List.
|
| + List<List> out = <List>[];
|
| + // This generates an exception on 32 bit machines.
|
| + for (var i = 0; i < 8; i++) {
|
| + out.add(new List(pow(2, 28) - 1));
|
| + }
|
| + // This generates an exception on 64 bit machines.
|
| + for (var i = 0; i < 64; i++) {
|
| + out.add(new List(pow(2, 58) - 1));
|
| + }
|
| }
|
|
|
| var tests = [
|
|
|