Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/memory/FreeList.java @ 210:05712c37c828
6676016: ParallelOldGC leaks memory
Summary: ensure that GCTask threads release resource and handle memory
Reviewed-by: jmasa, chrisphi
author | jcoomes |
---|---|
date | Wed, 18 Jun 2008 18:36:47 -0700 |
parents | c70a245cad3a |
children | d1605aabd0a1 |
rev | line source |
---|---|
152
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
1 /* |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
2 * @(#)FreeList.java |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
3 * |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
4 * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
5 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
6 * |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
7 * This code is free software; you can redistribute it and/or modify it |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
8 * under the terms of the GNU General Public License version 2 only, as |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
9 * published by the Free Software Foundation. |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
10 * |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
15 * accompanied this code). |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
16 * |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
20 * |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
22 * CA 95054 USA or visit www.sun.com if you need additional information or |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
23 * have any questions. |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
24 * |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
25 */ |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
26 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
27 package sun.jvm.hotspot.memory; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
28 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
29 import java.util.*; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
30 import sun.jvm.hotspot.debugger.*; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
31 import sun.jvm.hotspot.types.*; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
32 import sun.jvm.hotspot.runtime.*; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
33 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
34 public class FreeList extends VMObject { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
35 static { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
36 VM.registerVMInitializedObserver(new Observer() { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
37 public void update(Observable o, Object data) { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
38 initialize(VM.getVM().getTypeDataBase()); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
39 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
40 }); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
41 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
42 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
43 private static synchronized void initialize(TypeDataBase db) { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
44 Type type = db.lookupType("FreeList"); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
45 sizeField = type.getCIntegerField("_size"); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
46 countField = type.getCIntegerField("_count"); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
47 headerSize = type.getSize(); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
48 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
49 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
50 // Fields |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
51 private static CIntegerField sizeField; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
52 private static CIntegerField countField; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
53 private static long headerSize; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
54 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
55 //Constructor |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
56 public FreeList(Address address) { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
57 super(address); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
58 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
59 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
60 // Accessors |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
61 public long size() { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
62 return sizeField.getValue(addr); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
63 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
64 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
65 public long count() { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
66 return countField.getValue(addr); |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
67 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
68 |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
69 public static long sizeOf() { |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
70 return headerSize; |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
71 } |
c70a245cad3a
6670684: 4/5 SA command universe did not print out CMS space information
dcubed
parents:
diff
changeset
|
72 } |