annotate test/gc/survivorAlignment/TestAllocationInEden.java @ 22801:860297c03bbc

8037968: Add tests on alignment of objects copied to survivor space Reviewed-by: jmasa, dfazunen
author fzhinkin
date Wed, 26 Nov 2014 14:17:06 +0400
parents
children 75d8afb5d37a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22801
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
1 /*
860297c03bbc 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.
860297c03bbc 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.
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
4 *
860297c03bbc 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
860297c03bbc 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
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
7 * published by the Free Software Foundation.
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
8 *
860297c03bbc 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
860297c03bbc 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
860297c03bbc 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
860297c03bbc 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
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
13 * accompanied this code).
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
14 *
860297c03bbc 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
860297c03bbc 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,
860297c03bbc 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.
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
18 *
860297c03bbc 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
860297c03bbc 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
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
21 * questions.
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
22 */
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
23
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
24 /**
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
25 * @test
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
26 * @bug 8031323
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
27 * @summary Verify that object's alignment in eden space is not affected by
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
28 * SurvivorAlignmentInBytes option.
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
29 * @library /testlibrary /testlibrary/whitebox
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
30 * @build TestAllocationInEden SurvivorAlignmentTestMain AlignmentHelper
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
31 * @run main ClassFileInstaller sun.hotspot.WhiteBox
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
32 * sun.hotspot.WhiteBox$WhiteBoxPermission
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
34 * -XX:+WhiteBoxAPI -XX:NewSize=64m -XX:MaxNewSize=64m
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
35 * -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
36 * -XX:SurvivorAlignmentInBytes=32 -XX:-UseTLAB
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
37 * -XX:OldSize=128m -XX:-ExplicitGCInvokesConcurrent
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
38 * TestAllocationInEden 10m 9 EDEN
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
39 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
40 * -XX:+WhiteBoxAPI -XX:NewSize=64m -XX:MaxNewSize=64m
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
41 * -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
42 * -XX:SurvivorAlignmentInBytes=32 -XX:-UseTLAB
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
43 * -XX:OldSize=128m -XX:-ExplicitGCInvokesConcurrent
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
44 * TestAllocationInEden 10m 47 EDEN
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
45 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
46 * -XX:+WhiteBoxAPI -XX:NewSize=64m -XX:MaxNewSize=64m
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
47 * -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
48 * -XX:SurvivorAlignmentInBytes=64 -XX:-UseTLAB
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
49 * -XX:OldSize=128m -XX:-ExplicitGCInvokesConcurrent
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
50 * TestAllocationInEden 10m 9 EDEN
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
51 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
52 * -XX:+WhiteBoxAPI -XX:NewSize=64m -XX:MaxNewSize=64m
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
53 * -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
54 * -XX:SurvivorAlignmentInBytes=64 -XX:-UseTLAB
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
55 * -XX:OldSize=128m -XX:-ExplicitGCInvokesConcurrent
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
56 * TestAllocationInEden 10m 87 EDEN
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
57 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
58 * -XX:+WhiteBoxAPI -XX:NewSize=64m -XX:MaxNewSize=64m
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
59 * -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
60 * -XX:SurvivorAlignmentInBytes=128 -XX:-UseTLAB
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
61 * -XX:OldSize=128m -XX:-ExplicitGCInvokesConcurrent
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
62 * TestAllocationInEden 10m 9 EDEN
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
63 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
64 * -XX:+WhiteBoxAPI -XX:NewSize=64m -XX:MaxNewSize=64m
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
65 * -XX:SurvivorRatio=1 -XX:+UnlockExperimentalVMOptions
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
66 * -XX:SurvivorAlignmentInBytes=128 -XX:-UseTLAB
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
67 * -XX:OldSize=128m -XX:-ExplicitGCInvokesConcurrent
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
68 * TestAllocationInEden 10m 147 EDEN
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
69 */
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
70 public class TestAllocationInEden {
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
71 public static void main(String args[]) {
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
72 SurvivorAlignmentTestMain test
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
73 = SurvivorAlignmentTestMain.fromArgs(args);
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
74 System.out.println(test);
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
75
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
76 long expectedMemoryUsage = test.getExpectedMemoryUsage();
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
77 test.baselineMemoryAllocation();
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
78 System.gc();
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
79
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
80 test.allocate();
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
81
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
82 test.verifyMemoryUsage(expectedMemoryUsage);
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
83 }
860297c03bbc 8037968: Add tests on alignment of objects copied to survivor space
fzhinkin
parents:
diff changeset
84 }