|
1 Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. |
|
2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
3 |
|
4 This code is free software; you can redistribute it and/or modify it |
|
5 under the terms of the GNU General Public License version 2 only, as |
|
6 published by the Free Software Foundation. |
|
7 |
|
8 This code is distributed in the hope that it will be useful, but WITHOUT |
|
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
11 version 2 for more details (a copy is included in the LICENSE file that |
|
12 accompanied this code). |
|
13 |
|
14 You should have received a copy of the GNU General Public License version |
|
15 2 along with this work; if not, write to the Free Software Foundation, |
|
16 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
17 |
|
18 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
19 or visit www.oracle.com if you need additional information or have any |
|
20 questions. |
|
21 |
|
22 Test garbage collector compaction. |
|
23 |
|
24 The test starts several threads which create objects using |
|
25 given garbage producer until OOM. The references are kept |
|
26 in an array. The references to even elements are cleared |
|
27 and objects of double size are created until OOM. The garbage |
|
28 collector will have to compact free space to free memory for |
|
29 new objects. |
|
30 |
|
31 The tests differ by object types used for first and second phase: |
|
32 - _Arrays tests randomly use arrays of basic types and Object[] arrays. |
|
33 - _Strings tests use random strings. |
|
34 - _NonbranchyTree tests use nonbranchy trees. |
|
35 - _InternedStrings use interned strings. |
|
36 - _ArrayOf tests use array with two elements for second phase, |
|
37 the elements of which point to objects of same type. |
|
38 - _TwoFields tests use object with two fields for second phase, |
|
39 which point to objects of same type. |
|
40 |
|
41 Each *1 test is the single-threaded version of corresponding test. |
|
42 |
|
43 The Humongous tests are similar to compact tests. However they used |
|
44 the fixed size of objects which allocation requre compaction. The |
|
45 size is specific for G1 GC (about 1M and 5M) and require humongous |
|
46 object creation in G1. |