Mercurial > hg > truffle
annotate test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java @ 21118:ae4941602cfa
mx: fix crash when there are no services
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 27 Apr 2015 12:04:10 +0200 |
parents | 75d8afb5d37a |
children |
rev | line source |
---|---|
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
1 /* |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
4b7c96fba3d8
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. |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
4 * |
4b7c96fba3d8
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 |
4b7c96fba3d8
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 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
8 * |
4b7c96fba3d8
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 |
4b7c96fba3d8
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 |
4b7c96fba3d8
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 |
4b7c96fba3d8
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 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
13 * accompanied this code). |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
14 * |
4b7c96fba3d8
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 |
4b7c96fba3d8
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, |
4b7c96fba3d8
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. |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
18 * |
4b7c96fba3d8
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 |
4b7c96fba3d8
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 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
21 * questions. |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
22 */ |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
23 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
24 /** |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
25 * @test |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
26 * @bug 8031323 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
27 * @summary Verify that objects promoted from survivor space to tenured space |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
28 * during full GC are not aligned to SurvivorAlignmentInBytes value. |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
29 * @library /testlibrary /testlibrary/whitebox |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
30 * @build TestPromotionFromSurvivorToTenuredAfterFullGC |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
31 * SurvivorAlignmentTestMain AlignmentHelper |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
33 * sun.hotspot.WhiteBox$WhiteBoxPermission |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
34 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
35 * -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
20718
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
36 * -XX:OldSize=32m -XX:MaxHeapSize=160m |
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
37 * -XX:SurvivorRatio=1 -XX:-ExplicitGCInvokesConcurrent |
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
38 * -XX:+UnlockExperimentalVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
39 * -XX:SurvivorAlignmentInBytes=32 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
40 * TestPromotionFromSurvivorToTenuredAfterFullGC 10m 9 TENURED |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
41 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
42 * -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
20718
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
43 * -XX:OldSize=32m -XX:MaxHeapSize=160m |
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
44 * -XX:SurvivorRatio=1 -XX:-ExplicitGCInvokesConcurrent |
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
45 * -XX:+UnlockExperimentalVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
46 * -XX:SurvivorAlignmentInBytes=32 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
47 * TestPromotionFromSurvivorToTenuredAfterFullGC 20m 47 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
48 * TENURED |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
49 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
50 * -XX:+WhiteBoxAPI -XX:NewSize=200m -XX:MaxNewSize=200m |
20718
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
51 * -XX:OldSize=32m -XX:MaxHeapSize=232m |
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
52 * -XX:SurvivorRatio=1 -XX:-ExplicitGCInvokesConcurrent |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
53 * -XX:+UnlockExperimentalVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
54 * -XX:SurvivorAlignmentInBytes=64 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
55 * TestPromotionFromSurvivorToTenuredAfterFullGC 10m 9 TENURED |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
56 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
57 * -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
20718
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
58 * -XX:OldSize=32m -XX:MaxHeapSize=160m |
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
59 * -XX:SurvivorRatio=1 -XX:-ExplicitGCInvokesConcurrent |
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
60 * -XX:+UnlockExperimentalVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
61 * -XX:SurvivorAlignmentInBytes=64 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
62 * TestPromotionFromSurvivorToTenuredAfterFullGC 20m 87 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
63 * TENURED |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
64 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
65 * -XX:+WhiteBoxAPI -XX:NewSize=256m -XX:MaxNewSize=256m |
20718
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
66 * -XX:OldSize=32M -XX:MaxHeapSize=288m |
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
67 * -XX:SurvivorRatio=1 -XX:-ExplicitGCInvokesConcurrent |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
68 * -XX:+UnlockExperimentalVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
69 * -XX:SurvivorAlignmentInBytes=128 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
70 * TestPromotionFromSurvivorToTenuredAfterFullGC 10m 9 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
71 * TENURED |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
72 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
73 * -XX:+WhiteBoxAPI -XX:NewSize=128m -XX:MaxNewSize=128m |
20718
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
74 * -XX:OldSize=32m -XX:MaxHeapSize=160m |
75d8afb5d37a
8066143: [TESTBUG] New tests in gc/survivorAlignment/ fails
fzhinkin
parents:
20717
diff
changeset
|
75 * -XX:SurvivorRatio=1 -XX:-ExplicitGCInvokesConcurrent |
20717
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
76 * -XX:+UnlockExperimentalVMOptions |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
77 * -XX:SurvivorAlignmentInBytes=128 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
78 * TestPromotionFromSurvivorToTenuredAfterFullGC 20m 147 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
79 * TENURED |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
80 */ |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
81 public class TestPromotionFromSurvivorToTenuredAfterFullGC { |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
82 public static void main(String args[]) { |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
83 SurvivorAlignmentTestMain test |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
84 = SurvivorAlignmentTestMain.fromArgs(args); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
85 System.out.println(test); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
86 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
87 long expectedMemoryUsage = test.getExpectedMemoryUsage(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
88 test.baselineMemoryAllocation(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
89 System.gc(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
90 // increase expected usage by current old gen usage |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
91 expectedMemoryUsage += SurvivorAlignmentTestMain.getAlignmentHelper( |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
92 SurvivorAlignmentTestMain.HeapSpace.TENURED) |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
93 .getActualMemoryUsage(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
94 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
95 test.allocate(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
96 SurvivorAlignmentTestMain.WHITE_BOX.youngGC(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
97 System.gc(); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
98 |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
99 test.verifyMemoryUsage(expectedMemoryUsage); |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
100 } |
4b7c96fba3d8
8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff
changeset
|
101 } |