OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Deliberately fragment the heap and test that GC peformance does not | 5 // Deliberately fragment the heap and test that GC peformance does not |
6 // break down. See https://github.com/dart-lang/sdk/issues/29588 | 6 // break down. See https://github.com/dart-lang/sdk/issues/29588 |
7 // Normally runs in about 6-7 seconds on an x64 machine, using about 2.5Gbytes | 7 // Normally runs in about 6-7 seconds on an x64 machine, using about 2.5Gbytes |
8 // of memory. | 8 // of memory. |
9 // | 9 // |
10 // This test is deliberately CPU-light and so it can make a lot of | 10 // This test is deliberately CPU-light and so it can make a lot of |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 // Clear the large items so that the heap is full of 260-word gaps. | 22 // Clear the large items so that the heap is full of 260-word gaps. |
23 for (int i = 0; i < arrays.length; i += 2) { | 23 for (int i = 0; i < arrays.length; i += 2) { |
24 arrays[i] = null; | 24 arrays[i] = null; |
25 } | 25 } |
26 // Allocate a lot of 300-word objects that don't fit in the gaps. | 26 // Allocate a lot of 300-word objects that don't fit in the gaps. |
27 for (int i = 0; i < 600000; i++) { | 27 for (int i = 0; i < 600000; i++) { |
28 arrays.add(new List(300)); | 28 arrays.add(new List(300)); |
29 } | 29 } |
30 } | 30 } |
OLD | NEW |