author | lana |
Thu, 12 May 2016 15:15:02 +0000 | |
changeset 37915 | be4ff50b6cb6 |
parent 36851 | 03e2f4d0a421 |
child 40631 | ed82623d7831 |
permissions | -rw-r--r-- |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
1 |
/* |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28203
diff
changeset
|
2 |
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
4 |
* |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
8 |
* |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
13 |
* accompanied this code). |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
14 |
* |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
18 |
* |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
21 |
* questions. |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
22 |
*/ |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
23 |
|
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
24 |
/** |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
25 |
* @test |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
26 |
* @bug 8031323 |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
27 |
* @summary Verify that objects promoted from eden space to survivor space after |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
28 |
* minor GC are aligned to SurvivorAlignmentInBytes. |
33730
30e064828045
8140189: [TESTBUG] Get rid of "@library /../../test/lib" in jtreg tests
cjplummer
parents:
31608
diff
changeset
|
29 |
* @library /testlibrary /test/lib |
36851 | 30 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28203
diff
changeset
|
31 |
* java.management |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
32 |
* @build TestPromotionToSurvivor |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
33 |
* SurvivorAlignmentTestMain AlignmentHelper |
31608 | 34 |
* @ignore 8129886 |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
35 |
* @run main ClassFileInstaller sun.hotspot.WhiteBox |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
36 |
* sun.hotspot.WhiteBox$WhiteBoxPermission |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
37 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
38 |
* -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
39 |
* -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
40 |
* -XX:SurvivorAlignmentInBytes=32 -XX:OldSize=128m |
31370
e27de7435453
8078669: G1 applies SurvivorAlignmentInBytes to both survivor and old gen
tschatzl
parents:
29678
diff
changeset
|
41 |
* -XX:MaxHeapSize=256m -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
42 |
* TestPromotionToSurvivor 10m 9 SURVIVOR |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
43 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
44 |
* -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
45 |
* -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
46 |
* -XX:SurvivorAlignmentInBytes=32 -XX:OldSize=128m |
31370
e27de7435453
8078669: G1 applies SurvivorAlignmentInBytes to both survivor and old gen
tschatzl
parents:
29678
diff
changeset
|
47 |
* -XX:MaxHeapSize=256m -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
48 |
* TestPromotionToSurvivor 20m 47 SURVIVOR |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
49 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
50 |
* -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
51 |
* -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
52 |
* -XX:SurvivorAlignmentInBytes=64 -XX:OldSize=128m |
31370
e27de7435453
8078669: G1 applies SurvivorAlignmentInBytes to both survivor and old gen
tschatzl
parents:
29678
diff
changeset
|
53 |
* -XX:MaxHeapSize=256m -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
54 |
* TestPromotionToSurvivor 8m 9 SURVIVOR |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
55 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
56 |
* -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
57 |
* -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
58 |
* -XX:SurvivorAlignmentInBytes=64 -XX:OldSize=128m |
31370
e27de7435453
8078669: G1 applies SurvivorAlignmentInBytes to both survivor and old gen
tschatzl
parents:
29678
diff
changeset
|
59 |
* -XX:MaxHeapSize=256m -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
60 |
* TestPromotionToSurvivor 20m 87 SURVIVOR |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
61 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
62 |
* -XX:+WhiteBoxAPI -XX:NewSize=256m -XX:MaxNewSize=256m |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
63 |
* -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions |
28182
8a51e754d3d8
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
27890
diff
changeset
|
64 |
* -XX:SurvivorAlignmentInBytes=128 -XX:OldSize=128m |
31370
e27de7435453
8078669: G1 applies SurvivorAlignmentInBytes to both survivor and old gen
tschatzl
parents:
29678
diff
changeset
|
65 |
* -XX:MaxHeapSize=384m -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
66 |
* TestPromotionToSurvivor 10m 9 SURVIVOR |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
67 |
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
68 |
* -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
69 |
* -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
70 |
* -XX:SurvivorAlignmentInBytes=128 -XX:OldSize=128m |
31370
e27de7435453
8078669: G1 applies SurvivorAlignmentInBytes to both survivor and old gen
tschatzl
parents:
29678
diff
changeset
|
71 |
* -XX:MaxHeapSize=256m -XX:-ExplicitGCInvokesConcurrent -XX:-ResizePLAB |
27890
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
72 |
* TestPromotionToSurvivor 20m 147 SURVIVOR |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
73 |
*/ |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
74 |
public class TestPromotionToSurvivor { |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
75 |
public static void main(String args[]) { |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
76 |
SurvivorAlignmentTestMain test |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
77 |
= SurvivorAlignmentTestMain.fromArgs(args); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
78 |
System.out.println(test); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
79 |
|
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
80 |
long expectedUsage = test.getExpectedMemoryUsage(); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
81 |
test.baselineMemoryAllocation(); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
82 |
SurvivorAlignmentTestMain.WHITE_BOX.fullGC(); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
83 |
|
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
84 |
test.allocate(); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
85 |
SurvivorAlignmentTestMain.WHITE_BOX.youngGC(); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
86 |
|
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
87 |
test.verifyMemoryUsage(expectedUsage); |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
88 |
} |
9c0e6a049e1f
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
89 |
} |