dart-sdk/tests/standalone/out_of_memory_slow_growth_test.dart
Ryan Macnak 7d79d215db [vm] Use handles instead of array allocation when executing catch entry moves
Issue https://github.com/dart-lang/sdk/issues/43543

Change-Id: I61472be2507ce97721ab162a8c86f9662ec27f72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164540
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-02 15:59:18 +00:00

25 lines
658 B
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// VMOptions=--old_gen_heap_size=20
// VMOptions=--old_gen_heap_size=20 --enable_vm_service --pause_isolates_on_unhandled_exceptions
import "package:expect/expect.dart";
main() {
var leak;
var exceptionThrown = false;
try {
leak = [];
while (true) {
leak = [leak];
}
} on OutOfMemoryError catch (exception) {
leak = null;
exceptionThrown = true;
print("Okay");
}
Expect.isTrue(exceptionThrown);
}