Mercurial > hg > truffle
annotate test/compiler/6849574/Test.java @ 20218:828056cf311f
8040792: G1: Memory usage calculation uses sizeof(this) instead of sizeof(classname)
Summary: A few locations in the code use sizeof(this) which returns the size of the pointer instead of sizeof(classname) which returns the size of the sum of its members. This change fixes these errors and adds a few tests.
Reviewed-by: mgerdin, brutisso
author | tschatzl |
---|---|
date | Mon, 21 Jul 2014 09:40:19 +0200 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
819
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
819
diff
changeset
|
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
819
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
4 * |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
8 * |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
13 * accompanied this code). |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
14 * |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
18 * |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
819
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
819
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
819
diff
changeset
|
21 * questions. |
819
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
22 * |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
23 */ |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
24 |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
25 /** |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
26 * @test |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
27 * @bug 6849574 |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
28 * @summary VM crash using NonBlockingHashMap (high_scale_lib) |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
29 * |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
30 * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC Test |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
31 */ |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
32 |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
33 import java.util.concurrent.atomic.*; |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
34 |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
35 public class Test extends Thread { |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
36 |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
37 public static void main(String[] args) { |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
38 AtomicReferenceArray a = new AtomicReferenceArray(10000); |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
39 for (int i = 0; i < 100000; i++) { |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
40 a.getAndSet(9999, new Object()); |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
41 if (i > 99990) System.gc(); |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
42 } |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
43 } |
c6386080541b
6849574: VM crash using NonBlockingHashMap (high_scale_lib)
never
parents:
diff
changeset
|
44 } |