Created
May 5, 2011 07:52
-
-
Save rednaxelafx/956694 to your computer and use it in GitHub Desktop.
Another demo on primitive type arrays and wrapper type arrays in a Java program running on HotSpot, using SA on a core dump. Env: JDK6u25, x64, -Xmx10m (-server and -XX:+UseCompressedOops are on by default)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ java -version | |
java version "1.6.0_25" | |
Java(TM) SE Runtime Environment (build 1.6.0_25-b06) | |
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode) | |
$ alias -p | grep clhsdb | |
alias clhsdb='java -classpath .:$JAVA_HOME/lib/sa-jdi.jar sun.jvm.hotspot.CLHSDB' | |
$ clhsdb | |
hsdb> help | |
Available commands: | |
assert true | false | |
attach pid | exec core | |
class name | |
classes | |
detach | |
dis address [ length ] | |
dumpclass { address | name } [ directory ] | |
dumpcodecache | |
dumpheap [ file ] | |
echo [ true | false ] | |
examine [ address/count ] | [ address,address] | |
field [ type [ name fieldtype isStatic offset address ] ] | |
findpc address | |
flags [ flag ] | |
help [ command ] | |
history | |
inspect expression | |
jdis address | |
jhisto | |
jseval script | |
jsload file | |
jstack [-v] | |
livenmethods | |
mem address [ length ] | |
pmap | |
print expression | |
printas type expression | |
printstatics [ type ] | |
pstack [-v] | |
quit | |
reattach | |
revptrs address | |
scanoops start end [ type ] | |
search [ heap | perm | rawheap | codecache | threads ] value | |
source filename | |
symbol name | |
sysprops | |
thread { -a | id } | |
threads | |
tokenize ... | |
type [ type [ name super isOop isInteger isUnsigned size ] ] | |
universe | |
verbose true | false | |
versioncheck [ true | false ] | |
whatis address | |
where { -a | id } | |
hsdb> attach /home/sajia/jdk/6u25_x64/bin/java core.23346 | |
Opening core file, please wait... | |
hsdb> universe | |
Heap Parameters: | |
ParallelScavengeHeap [ PSYoungGen [ eden = [0x00000000ffcb0000,0x00000000ffeb2240,0x00000000fff40000] , from = [0x00000000fffa0000,0x00000000fffa0000,0x0000000100000000] , to = [0x00000000fff40000,0x00000000fff40000,0x00000000fffa0000] ] PSOldGen [ [0x00000000ff600000,0x00000000ff600000,0x00000000ffcb0000] ] PSPermGen [ [0x00000000fa400000,0x00000000fa67d6d0,0x00000000fb8c0000] ] ] hsdb> | |
hsdb> scanoops 0x00000000ff600000 0x0000000100000000 java.lang.Integer | |
0x00000000ffcbbc00 java/lang/Integer | |
0x00000000ffcbbc98 java/lang/Integer | |
0x00000000ffcbbd00 java/lang/Integer | |
... | |
0x00000000ffda5b28 java/lang/Integer | |
0x00000000ffda5b38 java/lang/Integer | |
... | |
0x00000000ffea5018 java/lang/Integer | |
0x00000000ffea5028 java/lang/Integer | |
hsdb> inspect 0x00000000ffda5b28 | |
instance of Oop for java/lang/Integer @ 0x00000000ffda5b28 @ 0x00000000ffda5b28 (size = 16) | |
_mark: 1 | |
value: 431 | |
hsdb> inspect 0x00000000ffda5b38 | |
instance of Oop for java/lang/Integer @ 0x00000000ffda5b38 @ 0x00000000ffda5b38 (size = 16) | |
_mark: 1 | |
value: 432 | |
hsdb> examine 0x00000000ffda5b28/10 | |
0x00000000ffda5b28: 0x0000000000000001 0x000001affa4a2688 0x0000000000000001 | |
0x00000000ffda5b40: 0x000001b0fa4a2688 0x0000000000000001 0x000001b1fa4a2688 | |
0x00000000ffda5b58: 0x0000000000000001 0x000001b2fa4a2688 0x0000000000000001 | |
0x00000000ffda5b70: 0x000001b3fa4a2688 | |
hsdb> revptrs 0x00000000ffda5b28 | |
Computing reverse pointers... | |
Done. | |
ObjArray @ 0x00000000ffd65b18 | |
hsdb> inspect 0x00000000ffd65b18 | |
instance of ObjArray @ 0x00000000ffd65b18 @ 0x00000000ffd65b18 (size = 262160) | |
_mark: 1 | |
0: Oop for java/lang/Integer @ 0x00000000ffce4ff8 Oop for java/lang/Integer @ 0x00000000ffce4ff8 | |
1: Oop for java/lang/Integer @ 0x00000000ffce5008 Oop for java/lang/Integer @ 0x00000000ffce5008 | |
2: Oop for java/lang/Integer @ 0x00000000ffce5018 Oop for java/lang/Integer @ 0x00000000ffce5018 | |
... | |
65534: Oop for java/lang/Integer @ 0x00000000ffea5018 Oop for java/lang/Integer @ 0x00000000ffea5018 | |
65535: Oop for java/lang/Integer @ 0x00000000ffea5028 Oop for java/lang/Integer @ 0x00000000ffea5028 | |
hsdb> inspect 0x00000000ffce4ff8 | |
instance of Oop for java/lang/Integer @ 0x00000000ffce4ff8 @ 0x00000000ffce4ff8 (size = 16) | |
_mark: 1 | |
value: 256 | |
hsdb> inspect 0x00000000ffce5008 | |
instance of Oop for java/lang/Integer @ 0x00000000ffce5008 @ 0x00000000ffce5008 (size = 16) | |
_mark: 1 | |
value: 257 | |
hsdb> inspect 0x00000000ffea5028 | |
instance of Oop for java/lang/Integer @ 0x00000000ffea5028 @ 0x00000000ffea5028 (size = 16) | |
_mark: 1 | |
value: 65791 | |
hsdb> examine 0x00000000ffd65b18/6 | |
0x00000000ffd65b18: 0x0000000000000001 0x00010000fa67c368 0xffce5008ffce4ff8 | |
0x00000000ffd65b30: 0xffce5028ffce5018 0xffce5048ffce5038 0xffce5068ffce5058 | |
hsdb> inspect 0x00000000fa67c368 | |
instance of ObjArrayKlass for InstanceKlass for java/lang/Integer @ 0x00000000fa67c368 @ 0x00000000fa67c368 (size = 584) | |
_mark: 1 | |
_java_mirror: Oop for java/lang/Class @ 0x00000000fa67c5d0 Oop for java/lang/Class @ 0x00000000fa67c5d0 | |
_super: ObjArrayKlass for InstanceKlass for java/lang/Number @ 0x00000000fa67c098 Oop @ 0x00000000fa67c098 | |
_layout_helper: -2146431998 | |
_name: #[Ljava/lang/Integer; @ 0x00000000fa49ef20 Oop @ 0x00000000fa49ef20 | |
_access_flags: -2147483648 | |
_subklass: null null | |
_next_sibling: null null | |
_alloc_count: 0 | |
_dimension: 1 | |
_higher_dimension: null null | |
_lower_dimension: null null | |
_vtable_len: 5 | |
_alloc_size: 0 | |
_component_mirror: Oop for java/lang/Class @ 0x00000000fa4a2958 Oop for java/lang/Class @ 0x00000000fa4a2958 | |
_element_klass: InstanceKlass for java/lang/Integer @ 0x00000000fa4a2688 Oop @ 0x00000000fa4a2688 | |
_bottom_klass: InstanceKlass for java/lang/Integer @ 0x00000000fa4a2688 Oop @ 0x00000000fa4a2688 | |
hsdb> class java.lang.Integer | |
java/lang/Integer @0x00000000fa4a2688 | |
hsdb> print 0x00000000fa4a2688 | |
public final class java.lang.Integer [signature Ljava/lang/Number;Ljava/lang/Comparable<Ljava/lang/Integer;>;] @0x00000000fa4a2688 | |
Super Class | |
public abstract class java.lang.Number @0x00000000fa497350 | |
Interfaces | |
public abstract interface java.lang.Comparable [signature <T:Ljava/lang/Object;>Ljava/lang/Object;] @0x00000000fa40beb8 | |
Fields | |
public static final int MIN_VALUE; (offset = 704) | |
public static final int MAX_VALUE; (offset = 708) | |
public static final java.lang.Class TYPE; [signature Ljava/lang/Class<Ljava/lang/Integer;>;] (offset = 672) | |
static final char[] digits; (offset = 676) | |
static final char[] DigitTens; (offset = 680) | |
static final char[] DigitOnes; (offset = 684) | |
static final int[] sizeTable; (offset = 688) | |
private static java.lang.String integerCacheHighPropValue; (offset = 692) | |
private final int value; (offset = 12) | |
public static final int SIZE; (offset = 712) | |
private static final long serialVersionUID; (offset = 696) | |
Methods | |
public void <init>(int) @0x00000000fa4a04a8; | |
public void <init>(java.lang.String) @0x00000000fa4a0598; | |
static void <clinit>() @0x00000000fa4a25e8; | |
public static int numberOfLeadingZeros(int) @0x00000000fa4a1688; | |
public static int numberOfTrailingZeros(int) @0x00000000fa4a17b8; | |
public static int bitCount(int) @0x00000000fa4a18c8; | |
public boolean equals(java.lang.Object) @0x00000000fa4a0d90; | |
public static java.lang.String toString(int, int) @0x00000000fa49f5e0; | |
public static java.lang.String toString(int) @0x00000000fa49faa8; | |
public java.lang.String toString() @0x00000000fa4a0bb8; | |
public int hashCode() @0x00000000fa4a0c98; | |
public static int reverseBytes(int) @0x00000000fa4a1d78; | |
public int compareTo(java.lang.Integer) @0x00000000fa4a1378; | |
public [bridge] [synthetic] int compareTo(java.lang.Object) @0x00000000fa4a1e58; | |
public byte byteValue() @0x00000000fa4a0678; | |
public short shortValue() @0x00000000fa4a0758; | |
public int intValue() @0x00000000fa4a0838; | |
public long longValue() @0x00000000fa4a0918; | |
public float floatValue() @0x00000000fa4a09f8; | |
public double doubleValue() @0x00000000fa4a0ad8; | |
public static java.lang.Integer valueOf(java.lang.String, int) @0x00000000fa4a00e0; | |
public static java.lang.Integer valueOf(java.lang.String) @0x00000000fa4a01c8; | |
public static java.lang.Integer valueOf(int) @0x00000000fa4a03c0; | |
public static java.lang.String toHexString(int) @0x00000000fa49f6c0; | |
public static java.lang.Integer decode(java.lang.String) @0x00000000fa4a1280; | |
static void getChars(int, int, char[]) @0x00000000fa49fc18; | |
static [synthetic] java.lang.String access$000() @0x00000000fa4a1f30; | |
static void getAndRemoveCacheProperties() @0x00000000fa4a02c8; | |
public static int reverse(int) @0x00000000fa4a1ba8; | |
public static int parseInt(java.lang.String, int) @0x00000000fa49ff18; | |
public static int parseInt(java.lang.String) @0x00000000fa49fff8; | |
public static java.lang.Integer getInteger(java.lang.String) @0x00000000fa4a0e70; | |
public static java.lang.Integer getInteger(java.lang.String, int) @0x00000000fa4a0f60; | |
public static java.lang.Integer getInteger(java.lang.String, java.lang.Integer) @0x00000000fa4a10a0; | |
public static int highestOneBit(int) @0x00000000fa4a1478; | |
public static int lowestOneBit(int) @0x00000000fa4a1558; | |
public static int rotateLeft(int, int) @0x00000000fa4a19a8; | |
public static int rotateRight(int, int) @0x00000000fa4a1a88; | |
public static int signum(int) @0x00000000fa4a1c88; | |
static int stringSize(int) @0x00000000fa49fd08; | |
public static java.lang.String toBinaryString(int) @0x00000000fa49f880; | |
public static java.lang.String toOctalString(int) @0x00000000fa49f7a0; | |
private static java.lang.String toUnsignedString(int, int) @0x00000000fa49f998; | |
Constant Pool | |
Constant Pool of [public final class java.lang.Integer [signature Ljava/lang/Number;Ljava/lang/Comparable<Ljava/lang/Integer;>;] @0x00000000fa4a2688] @0x00000000fa49e480 | |
hsdb> print 0x00000000fa4a04a8 | |
public void <init>(int) @0x00000000fa4a04a8 | |
Holder Class | |
public final class java.lang.Integer [signature Ljava/lang/Number;Ljava/lang/Comparable<Ljava/lang/Integer;>;] @0x00000000fa4a2688 | |
Compiled Code | |
Disassembly for compiled method [public void <init>(int) @0x00000000fa4a04a8 ] @0x00002aaaab0831d0 | |
Bytecode | |
line bci bytecode | |
642 0 aload_0 [fast_aload_0] | |
642 1 invokespecial #252 [Method void <init>()] of public abstract class java.lang.Number @0x00000000fa497350 | |
643 4 aload_0 [fast_aload_0] | |
643 5 iload_1 | |
643 6 putfield #229 [Field int value] [fast_iputfield] of public final class java.lang.Integer [signature Ljava/lang/Number;Ljava/lang/Comparable<Ljava/lang/Integer;>;] @0x00000000fa4a2688 | |
644 9 return | |
Constant Pool | |
Constant Pool of [public final class java.lang.Integer [signature Ljava/lang/Number;Ljava/lang/Comparable<Ljava/lang/Integer;>;] @0x00000000fa4a2688] @0x00000000fa49e480 | |
hsdb> inspect 0x00000000fa49e480 | |
instance of ConstantPool for java/lang/Integer @ 0x00000000fa49e480 @ 0x00000000fa49e480 (size = 2256) | |
_mark: 1 | |
_tags: [B @ 0x00000000fa49ed50 Oop for [B @ 0x00000000fa49ed50 | |
_cache: ConstantPoolCache for java/lang/Integer @ 0x00000000fa56eae0 Oop @ 0x00000000fa56eae0 | |
_pool_holder: InstanceKlass for java/lang/Integer @ 0x00000000fa4a2688 Oop @ 0x00000000fa4a2688 | |
JVM_CONSTANT_Integer: -2147483648 | |
JVM_CONSTANT_Integer: -2147483647 | |
JVM_CONSTANT_Integer: 52429 | |
JVM_CONSTANT_Integer: 65280 | |
JVM_CONSTANT_Integer: 65536 | |
JVM_CONSTANT_Integer: 99999 | |
JVM_CONSTANT_Integer: 999999 | |
JVM_CONSTANT_Integer: 9999999 | |
JVM_CONSTANT_Integer: 16711680 | |
JVM_CONSTANT_Integer: 99999999 | |
JVM_CONSTANT_Integer: 252645135 | |
JVM_CONSTANT_Integer: 858993459 | |
JVM_CONSTANT_Integer: 999999999 | |
JVM_CONSTANT_Integer: 1431655765 | |
JVM_CONSTANT_Integer: 2147483647 | |
JVM_CONSTANT_Utf8: # greater than Character.MAX_RADIX @ 0x00000000fa49ee78 Oop @ 0x00000000fa49ee78 | |
JVM_CONSTANT_Utf8: # less than Character.MIN_RADIX @ 0x00000000fa49eeb0 Oop @ 0x00000000fa49eeb0 | |
JVM_CONSTANT_Utf8: ## @ 0x00000000fa44ec68 Oop @ 0x00000000fa44ec68 | |
JVM_CONSTANT_Utf8: #()B @ 0x00000000fa405dc8 Oop @ 0x00000000fa405dc8 | |
JVM_CONSTANT_Utf8: #()D @ 0x00000000fa405e58 Oop @ 0x00000000fa405e58 | |
JVM_CONSTANT_Utf8: #()F @ 0x00000000fa405e40 Oop @ 0x00000000fa405e40 | |
JVM_CONSTANT_Utf8: #()I @ 0x00000000fa405e10 Oop @ 0x00000000fa405e10 | |
JVM_CONSTANT_Utf8: #()J @ 0x00000000fa405e28 Oop @ 0x00000000fa405e28 | |
JVM_CONSTANT_Utf8: #()Ljava/lang/String; @ 0x00000000fa406630 Oop @ 0x00000000fa406630 | |
JVM_CONSTANT_Utf8: #()S @ 0x00000000fa405df8 Oop @ 0x00000000fa405df8 | |
JVM_CONSTANT_Utf8: #()V @ 0x00000000fa405d98 Oop @ 0x00000000fa405d98 | |
JVM_CONSTANT_Utf8: #()Z @ 0x00000000fa405db0 Oop @ 0x00000000fa405db0 | |
JVM_CONSTANT_Utf8: #(CI)I @ 0x00000000fa48c8f0 Oop @ 0x00000000fa48c8f0 | |
JVM_CONSTANT_Utf8: #(I)C @ 0x00000000fa40a0b0 Oop @ 0x00000000fa40a0b0 | |
JVM_CONSTANT_Utf8: #(I)I @ 0x00000000fa405e88 Oop @ 0x00000000fa405e88 | |
JVM_CONSTANT_Utf8: #(I)Ljava/lang/String; @ 0x00000000fa406b00 Oop @ 0x00000000fa406b00 | |
JVM_CONSTANT_Utf8: #(I)V @ 0x00000000fa405e70 Oop @ 0x00000000fa405e70 | |
JVM_CONSTANT_Utf8: #(II)I @ 0x00000000fa406b40 Oop @ 0x00000000fa406b40 | |
JVM_CONSTANT_Utf8: #(II)Ljava/lang/String; @ 0x00000000fa40a0e0 Oop @ 0x00000000fa40a0e0 | |
JVM_CONSTANT_Utf8: #(II[C)V @ 0x00000000fa40a128 Oop @ 0x00000000fa40a128 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/Object;)Z @ 0x00000000fa4060b8 Oop @ 0x00000000fa4060b8 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)I @ 0x00000000fa406108 Oop @ 0x00000000fa406108 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)Ljava/lang/Class; @ 0x00000000fa406400 Oop @ 0x00000000fa406400 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)Ljava/lang/String; @ 0x00000000fa4064d8 Oop @ 0x00000000fa4064d8 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)V @ 0x00000000fa4060e0 Oop @ 0x00000000fa4060e0 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)Z @ 0x00000000fa406130 Oop @ 0x00000000fa406130 | |
JVM_CONSTANT_Utf8: #([CII)V @ 0x00000000fa40a2b8 Oop @ 0x00000000fa40a2b8 | |
JVM_CONSTANT_Utf8: #- @ 0x00000000fa498268 Oop @ 0x00000000fa498268 | |
JVM_CONSTANT_Utf8: #-2147483648 @ 0x00000000fa478a30 Oop @ 0x00000000fa478a30 | |
JVM_CONSTANT_Utf8: #0 @ 0x00000000fa498280 Oop @ 0x00000000fa498280 | |
JVM_CONSTANT_Utf8: #0X @ 0x00000000fa49a8c0 Oop @ 0x00000000fa49a8c0 | |
JVM_CONSTANT_Utf8: #0x @ 0x00000000fa4982e8 Oop @ 0x00000000fa4982e8 | |
JVM_CONSTANT_Utf8: #<clinit> @ 0x00000000fa4041c0 Oop @ 0x00000000fa4041c0 | |
JVM_CONSTANT_Utf8: #<init> @ 0x00000000fa4041a8 Oop @ 0x00000000fa4041a8 | |
JVM_CONSTANT_Utf8: #Code @ 0x00000000fa4029f8 Oop @ 0x00000000fa4029f8 | |
JVM_CONSTANT_Utf8: #ConstantValue @ 0x00000000fa4029d8 Oop @ 0x00000000fa4029d8 | |
JVM_CONSTANT_Utf8: #DigitOnes @ 0x00000000fa49eee0 Oop @ 0x00000000fa49eee0 | |
JVM_CONSTANT_Utf8: #DigitTens @ 0x00000000fa49ef00 Oop @ 0x00000000fa49ef00 | |
JVM_CONSTANT_Utf8: #Exceptions @ 0x00000000fa402a10 Oop @ 0x00000000fa402a10 | |
JVM_CONSTANT_Utf8: #I @ 0x00000000fa405ff0 Oop @ 0x00000000fa405ff0 | |
JVM_CONSTANT_Utf8: #InnerClasses @ 0x00000000fa4029b8 Oop @ 0x00000000fa4029b8 | |
JVM_CONSTANT_Utf8: #J @ 0x00000000fa406008 Oop @ 0x00000000fa406008 | |
JVM_CONSTANT_Utf8: #LineNumberTable @ 0x00000000fa402a30 Oop @ 0x00000000fa402a30 | |
JVM_CONSTANT_Utf8: #Ljava/lang/Class; @ 0x00000000fa406900 Oop @ 0x00000000fa406900 | |
JVM_CONSTANT_Utf8: #Ljava/lang/String; @ 0x00000000fa406928 Oop @ 0x00000000fa406928 | |
JVM_CONSTANT_Utf8: #MAX_VALUE @ 0x00000000fa48d080 Oop @ 0x00000000fa48d080 | |
JVM_CONSTANT_Utf8: #MIN_VALUE @ 0x00000000fa48d180 Oop @ 0x00000000fa48d180 | |
JVM_CONSTANT_Utf8: #Negative sign in wrong position @ 0x00000000fa49a8d8 Oop @ 0x00000000fa49a8d8 | |
JVM_CONSTANT_Utf8: #SIZE @ 0x00000000fa48d2e8 Oop @ 0x00000000fa48d2e8 | |
JVM_CONSTANT_Utf8: #Signature @ 0x00000000fa402b30 Oop @ 0x00000000fa402b30 | |
JVM_CONSTANT_Utf8: #SourceFile @ 0x00000000fa402998 Oop @ 0x00000000fa402998 | |
JVM_CONSTANT_Utf8: #TYPE @ 0x00000000fa471b58 Oop @ 0x00000000fa471b58 | |
JVM_CONSTANT_Utf8: #[C @ 0x00000000fa4006f8 Oop @ 0x00000000fa4006f8 | |
JVM_CONSTANT_Utf8: #[I @ 0x00000000fa4012d8 Oop @ 0x00000000fa4012d8 | |
JVM_CONSTANT_Utf8: #[Ljava/lang/Integer; @ 0x00000000fa49ef20 Oop @ 0x00000000fa49ef20 | |
JVM_CONSTANT_Utf8: #access$000 @ 0x00000000fa424840 Oop @ 0x00000000fa424840 | |
JVM_CONSTANT_Utf8: #append @ 0x00000000fa404d38 Oop @ 0x00000000fa404d38 | |
JVM_CONSTANT_Utf8: #bitCount @ 0x00000000fa404ad0 Oop @ 0x00000000fa404ad0 | |
JVM_CONSTANT_Utf8: #byteValue @ 0x00000000fa405b50 Oop @ 0x00000000fa405b50 | |
JVM_CONSTANT_Utf8: #cache @ 0x00000000fa4049d0 Oop @ 0x00000000fa4049d0 | |
JVM_CONSTANT_Utf8: #charAt @ 0x00000000fa40a3e8 Oop @ 0x00000000fa40a3e8 | |
JVM_CONSTANT_Utf8: #compareTo @ 0x00000000fa405288 Oop @ 0x00000000fa405288 | |
JVM_CONSTANT_Utf8: #decode @ 0x00000000fa40a658 Oop @ 0x00000000fa40a658 | |
JVM_CONSTANT_Utf8: #digit @ 0x00000000fa48d3e0 Oop @ 0x00000000fa48d3e0 | |
JVM_CONSTANT_Utf8: #digits @ 0x00000000fa49ef48 Oop @ 0x00000000fa49ef48 | |
JVM_CONSTANT_Utf8: #doubleValue @ 0x00000000fa405c10 Oop @ 0x00000000fa405c10 | |
JVM_CONSTANT_Utf8: #equals @ 0x00000000fa404b10 Oop @ 0x00000000fa404b10 | |
JVM_CONSTANT_Utf8: #floatValue @ 0x00000000fa405bf0 Oop @ 0x00000000fa405bf0 | |
JVM_CONSTANT_Utf8: #forInputString @ 0x00000000fa49ef60 Oop @ 0x00000000fa49ef60 | |
JVM_CONSTANT_Utf8: #getAndRemoveCacheProperties @ 0x00000000fa42d148 Oop @ 0x00000000fa42d148 | |
JVM_CONSTANT_Utf8: #getChars @ 0x00000000fa40a738 Oop @ 0x00000000fa40a738 | |
JVM_CONSTANT_Utf8: #getInteger @ 0x00000000fa49ef80 Oop @ 0x00000000fa49ef80 | |
JVM_CONSTANT_Utf8: #getPrimitiveClass @ 0x00000000fa415f50 Oop @ 0x00000000fa415f50 | |
JVM_CONSTANT_Utf8: #getProperties @ 0x00000000fa42d1a0 Oop @ 0x00000000fa42d1a0 | |
JVM_CONSTANT_Utf8: #getProperty @ 0x00000000fa404740 Oop @ 0x00000000fa404740 | |
JVM_CONSTANT_Utf8: #hashCode @ 0x00000000fa404d70 Oop @ 0x00000000fa404d70 | |
JVM_CONSTANT_Utf8: #high @ 0x00000000fa49efa0 Oop @ 0x00000000fa49efa0 | |
JVM_CONSTANT_Utf8: #highestOneBit @ 0x00000000fa49efb8 Oop @ 0x00000000fa49efb8 | |
JVM_CONSTANT_Utf8: #int @ 0x00000000fa46b320 Oop @ 0x00000000fa46b320 | |
JVM_CONSTANT_Utf8: #intValue @ 0x00000000fa405bb0 Oop @ 0x00000000fa405bb0 | |
JVM_CONSTANT_Utf8: #integerCacheHighPropValue @ 0x00000000fa49efd8 Oop @ 0x00000000fa49efd8 | |
JVM_CONSTANT_Utf8: #isBooted @ 0x00000000fa49f008 Oop @ 0x00000000fa49f008 | |
JVM_CONSTANT_Utf8: #java.lang.Integer.IntegerCache.high @ 0x00000000fa49f028 Oop @ 0x00000000fa49f028 | |
JVM_CONSTANT_Utf8: #java/lang/Character @ 0x00000000fa402148 Oop @ 0x00000000fa402148 | |
JVM_CONSTANT_Utf8: #java/lang/Class @ 0x00000000fa401f48 Oop @ 0x00000000fa401f48 | |
JVM_CONSTANT_Utf8: #java/lang/Comparable @ 0x00000000fa40a8a8 Oop @ 0x00000000fa40a8a8 | |
JVM_CONSTANT_Utf8: #java/lang/IllegalArgumentException @ 0x00000000fa402e10 Oop @ 0x00000000fa402e10 | |
JVM_CONSTANT_Utf8: #java/lang/Integer @ 0x00000000fa4022a0 Oop @ 0x00000000fa4022a0 | |
JVM_CONSTANT_Utf8: #java/lang/Integer$IntegerCache @ 0x00000000fa4022c8 Oop @ 0x00000000fa4022c8 | |
JVM_CONSTANT_Utf8: #java/lang/NullPointerException @ 0x00000000fa403088 Oop @ 0x00000000fa403088 | |
JVM_CONSTANT_Utf8: #java/lang/Number @ 0x00000000fa494e00 Oop @ 0x00000000fa494e00 | |
JVM_CONSTANT_Utf8: #java/lang/NumberFormatException @ 0x00000000fa494e28 Oop @ 0x00000000fa494e28 | |
JVM_CONSTANT_Utf8: #java/lang/String @ 0x00000000fa401f70 Oop @ 0x00000000fa401f70 | |
JVM_CONSTANT_Utf8: #java/lang/StringBuilder @ 0x00000000fa4025b0 Oop @ 0x00000000fa4025b0 | |
JVM_CONSTANT_Utf8: #java/lang/System @ 0x00000000fa401ef8 Oop @ 0x00000000fa401ef8 | |
JVM_CONSTANT_Utf8: #java/util/Properties @ 0x00000000fa402790 Oop @ 0x00000000fa402790 | |
JVM_CONSTANT_Utf8: #length @ 0x00000000fa40aa90 Oop @ 0x00000000fa40aa90 | |
JVM_CONSTANT_Utf8: #longValue @ 0x00000000fa405bd0 Oop @ 0x00000000fa405bd0 | |
JVM_CONSTANT_Utf8: #lowestOneBit @ 0x00000000fa49f060 Oop @ 0x00000000fa49f060 | |
JVM_CONSTANT_Utf8: #null @ 0x00000000fa40ab00 Oop @ 0x00000000fa40ab00 | |
JVM_CONSTANT_Utf8: #numberOfLeadingZeros @ 0x00000000fa404a80 Oop @ 0x00000000fa404a80 | |
JVM_CONSTANT_Utf8: #numberOfTrailingZeros @ 0x00000000fa404aa8 Oop @ 0x00000000fa404aa8 | |
JVM_CONSTANT_Utf8: #parseInt @ 0x00000000fa49a988 Oop @ 0x00000000fa49a988 | |
JVM_CONSTANT_Utf8: #radix @ 0x00000000fa49f080 Oop @ 0x00000000fa49f080 | |
JVM_CONSTANT_Utf8: #remove @ 0x00000000fa42d698 Oop @ 0x00000000fa42d698 | |
JVM_CONSTANT_Utf8: #reverse @ 0x00000000fa471cf8 Oop @ 0x00000000fa471cf8 | |
JVM_CONSTANT_Utf8: #reverseBytes @ 0x00000000fa404fc8 Oop @ 0x00000000fa404fc8 | |
JVM_CONSTANT_Utf8: #rotateLeft @ 0x00000000fa49f098 Oop @ 0x00000000fa49f098 | |
JVM_CONSTANT_Utf8: #rotateRight @ 0x00000000fa49f0b8 Oop @ 0x00000000fa49f0b8 | |
JVM_CONSTANT_Utf8: #serialVersionUID @ 0x00000000fa40ac50 Oop @ 0x00000000fa40ac50 | |
JVM_CONSTANT_Utf8: #setProperties @ 0x00000000fa42d7d8 Oop @ 0x00000000fa42d7d8 | |
JVM_CONSTANT_Utf8: #shortValue @ 0x00000000fa405b90 Oop @ 0x00000000fa405b90 | |
JVM_CONSTANT_Utf8: #signum @ 0x00000000fa49f0d8 Oop @ 0x00000000fa49f0d8 | |
JVM_CONSTANT_Utf8: #sizeTable @ 0x00000000fa478b70 Oop @ 0x00000000fa478b70 | |
JVM_CONSTANT_Utf8: #startsWith @ 0x00000000fa40ac90 Oop @ 0x00000000fa40ac90 | |
JVM_CONSTANT_Utf8: #stringSize @ 0x00000000fa49f0f0 Oop @ 0x00000000fa49f0f0 | |
JVM_CONSTANT_Utf8: #substring @ 0x00000000fa40acd0 Oop @ 0x00000000fa40acd0 | |
JVM_CONSTANT_Utf8: #sun/misc/VM @ 0x00000000fa425868 Oop @ 0x00000000fa425868 | |
JVM_CONSTANT_Utf8: #toBinaryString @ 0x00000000fa49f110 Oop @ 0x00000000fa49f110 | |
JVM_CONSTANT_Utf8: #toHexString @ 0x00000000fa4080d8 Oop @ 0x00000000fa4080d8 | |
JVM_CONSTANT_Utf8: #toOctalString @ 0x00000000fa49f130 Oop @ 0x00000000fa49f130 | |
JVM_CONSTANT_Utf8: #toString @ 0x00000000fa404b40 Oop @ 0x00000000fa404b40 | |
JVM_CONSTANT_Utf8: #toUnsignedString @ 0x00000000fa49f150 Oop @ 0x00000000fa49f150 | |
JVM_CONSTANT_Utf8: #value @ 0x00000000fa4049e8 Oop @ 0x00000000fa4049e8 | |
JVM_CONSTANT_Utf8: #valueOf @ 0x00000000fa405c30 Oop @ 0x00000000fa405c30 | |
JVM_CONSTANT_Integer: 32 | |
JVM_CONSTANT_Long: 1360826667806852920 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/Character @ 0x00000000fa402148 Oop @ 0x00000000fa402148 | |
JVM_CONSTANT_Class: InstanceKlass for java/lang/Class @ 0x00000000fa421298 Oop @ 0x00000000fa421298 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/Comparable @ 0x00000000fa40a8a8 Oop @ 0x00000000fa40a8a8 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/IllegalArgumentException @ 0x00000000fa402e10 Oop @ 0x00000000fa402e10 | |
JVM_CONSTANT_Class: InstanceKlass for java/lang/Integer @ 0x00000000fa4a2688 Oop @ 0x00000000fa4a2688 | |
JVM_CONSTANT_Class: InstanceKlass for java/lang/Integer$IntegerCache @ 0x00000000fa67cad0 Oop @ 0x00000000fa67cad0 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/NullPointerException @ 0x00000000fa403088 Oop @ 0x00000000fa403088 | |
JVM_CONSTANT_Class: InstanceKlass for java/lang/Number @ 0x00000000fa497350 Oop @ 0x00000000fa497350 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/NumberFormatException @ 0x00000000fa494e28 Oop @ 0x00000000fa494e28 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/String @ 0x00000000fa401f70 Oop @ 0x00000000fa401f70 | |
JVM_CONSTANT_UnresolvedClass: #java/lang/StringBuilder @ 0x00000000fa4025b0 Oop @ 0x00000000fa4025b0 | |
JVM_CONSTANT_Class: InstanceKlass for java/lang/System @ 0x00000000fa430668 Oop @ 0x00000000fa430668 | |
JVM_CONSTANT_Class: InstanceKlass for java/util/Properties @ 0x00000000fa457c60 Oop @ 0x00000000fa457c60 | |
JVM_CONSTANT_Class: InstanceKlass for sun/misc/VM @ 0x00000000fa53d3c0 Oop @ 0x00000000fa53d3c0 | |
JVM_CONSTANT_Utf8: #Ljava/lang/Class<Ljava/lang/Integer;>; @ 0x00000000fa49f178 Oop @ 0x00000000fa49f178 | |
JVM_CONSTANT_Utf8: #Ljava/lang/Number;Ljava/lang/Comparable<Ljava/lang/Integer;>; @ 0x00000000fa49f1b0 Oop @ 0x00000000fa49f1b0 | |
JVM_CONSTANT_Utf8: #(I)Ljava/lang/Integer; @ 0x00000000fa405cf8 Oop @ 0x00000000fa405cf8 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/Integer;)I @ 0x00000000fa49f200 Oop @ 0x00000000fa49f200 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/Object;)I @ 0x00000000fa406090 Oop @ 0x00000000fa406090 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;I)I @ 0x00000000fa40b0f8 Oop @ 0x00000000fa40b0f8 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;I)Z @ 0x00000000fa40b120 Oop @ 0x00000000fa40b120 | |
JVM_CONSTANT_Utf8: #(I)Ljava/lang/StringBuilder; @ 0x00000000fa406a00 Oop @ 0x00000000fa406a00 | |
JVM_CONSTANT_Utf8: #()Ljava/util/Properties; @ 0x00000000fa42dc20 Oop @ 0x00000000fa42dc20 | |
JVM_CONSTANT_Utf8: #(Ljava/util/Properties;)V @ 0x00000000fa42dc50 Oop @ 0x00000000fa42dc50 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)Ljava/lang/Integer; @ 0x00000000fa49f228 Oop @ 0x00000000fa49f228 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;I)Ljava/lang/Integer; @ 0x00000000fa49f268 Oop @ 0x00000000fa49f268 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)Ljava/lang/NumberFormatException; @ 0x00000000fa49f2a8 Oop @ 0x00000000fa49f2a8 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/Object;)Ljava/lang/Object; @ 0x00000000fa417e38 Oop @ 0x00000000fa417e38 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;)Ljava/lang/StringBuilder; @ 0x00000000fa4069c0 Oop @ 0x00000000fa4069c0 | |
JVM_CONSTANT_Utf8: #(Ljava/lang/String;Ljava/lang/Integer;)Ljava/lang/Integer; @ 0x00000000fa49f2f0 Oop @ 0x00000000fa49f2f0 | |
JVM_CONSTANT_NameAndType: 4456553 | |
JVM_CONSTANT_NameAndType: 4456600 | |
JVM_CONSTANT_NameAndType: 5308481 | |
JVM_CONSTANT_NameAndType: 5308482 | |
JVM_CONSTANT_NameAndType: 5308509 | |
JVM_CONSTANT_NameAndType: 5374094 | |
JVM_CONSTANT_NameAndType: 4718672 | |
JVM_CONSTANT_NameAndType: 5439576 | |
JVM_CONSTANT_NameAndType: 4784237 | |
JVM_CONSTANT_NameAndType: 2293868 | |
JVM_CONSTANT_NameAndType: 2293885 | |
JVM_CONSTANT_NameAndType: 2555966 | |
JVM_CONSTANT_NameAndType: 2621550 | |
JVM_CONSTANT_NameAndType: 2687068 | |
JVM_CONSTANT_NameAndType: 2752601 | |
JVM_CONSTANT_NameAndType: 2818192 | |
JVM_CONSTANT_NameAndType: 2949182 | |
JVM_CONSTANT_NameAndType: 3145790 | |
JVM_CONSTANT_NameAndType: 3145827 | |
JVM_CONSTANT_NameAndType: 3604542 | |
JVM_CONSTANT_NameAndType: 11337881 | |
JVM_CONSTANT_NameAndType: 11403354 | |
JVM_CONSTANT_NameAndType: 2424982 | |
JVM_CONSTANT_NameAndType: 2883729 | |
JVM_CONSTANT_NameAndType: 2883734 | |
JVM_CONSTANT_NameAndType: 2883737 | |
JVM_CONSTANT_NameAndType: 3080343 | |
JVM_CONSTANT_NameAndType: 3473470 | |
JVM_CONSTANT_NameAndType: 3539087 | |
JVM_CONSTANT_NameAndType: 11534467 | |
JVM_CONSTANT_NameAndType: 11600015 | |
JVM_CONSTANT_NameAndType: 11665493 | |
JVM_CONSTANT_NameAndType: 11731046 | |
JVM_CONSTANT_NameAndType: 11796619 | |
JVM_CONSTANT_NameAndType: 3342437 | |
JVM_CONSTANT_NameAndType: 11862107 | |
JVM_CONSTANT_NameAndType: 11927705 | |
JVM_CONSTANT_NameAndType: 11993185 | |
JVM_CONSTANT_NameAndType: 12058757 | |
JVM_CONSTANT_NameAndType: 3407975 | |
JVM_CONSTANT_NameAndType: 12124245 | |
JVM_CONSTANT_NameAndType: 12189796 | |
JVM_CONSTANT_Fieldref: 12320929 | |
JVM_CONSTANT_Fieldref: 12386465 | |
JVM_CONSTANT_Fieldref: 12452001 | |
JVM_CONSTANT_Fieldref: 12517537 | |
JVM_CONSTANT_Fieldref: 12583073 | |
JVM_CONSTANT_Fieldref: 12648609 | |
JVM_CONSTANT_Fieldref: 12779681 | |
JVM_CONSTANT_Fieldref: 12255394 | |
JVM_CONSTANT_Fieldref: 12714146 | |
JVM_CONSTANT_Methodref: 13107357 | |
JVM_CONSTANT_Methodref: 14483614 | |
JVM_CONSTANT_Methodref: 12845217 | |
JVM_CONSTANT_Methodref: 13238433 | |
JVM_CONSTANT_Methodref: 13303969 | |
JVM_CONSTANT_Methodref: 13435041 | |
JVM_CONSTANT_Methodref: 13566113 | |
JVM_CONSTANT_Methodref: 13631649 | |
JVM_CONSTANT_Methodref: 13828257 | |
JVM_CONSTANT_Methodref: 13959329 | |
JVM_CONSTANT_Methodref: 14155937 | |
JVM_CONSTANT_Methodref: 14549153 | |
JVM_CONSTANT_Methodref: 14614689 | |
JVM_CONSTANT_Methodref: 14942369 | |
JVM_CONSTANT_Methodref: 12976292 | |
JVM_CONSTANT_Methodref: 14024869 | |
JVM_CONSTANT_Methodref: 14680229 | |
JVM_CONSTANT_Methodref: 12910758 | |
JVM_CONSTANT_Methodref: 13172902 | |
JVM_CONSTANT_Methodref: 13369510 | |
JVM_CONSTANT_Methodref: 13500582 | |
JVM_CONSTANT_Methodref: 13762726 | |
JVM_CONSTANT_Methodref: 13893798 | |
JVM_CONSTANT_Methodref: 14090406 | |
JVM_CONSTANT_Methodref: 14221478 | |
JVM_CONSTANT_Methodref: 12976295 | |
JVM_CONSTANT_Methodref: 13697191 | |
JVM_CONSTANT_Methodref: 14287015 | |
JVM_CONSTANT_Methodref: 14876839 | |
JVM_CONSTANT_Methodref: 14352552 | |
JVM_CONSTANT_Methodref: 14418088 | |
JVM_CONSTANT_Methodref: 14811304 | |
JVM_CONSTANT_Methodref: 14745769 | |
JVM_CONSTANT_Methodref: 13041834 | |
JVM_CONSTANT_Utf8: #Integer.java @ 0x00000000fa49f340 Oop @ 0x00000000fa49f340 | |
JVM_CONSTANT_Utf8: #IntegerCache @ 0x00000000fa49f360 Oop @ 0x00000000fa49f360 | |
hsdb> detach | |
hsdb> Input stream closed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fx; | |
import java.util.*; | |
import sun.jvm.hotspot.oops.*; | |
public class JavaObjectSizeCollector implements OopVisitor { | |
private long totalSize; | |
private Set<Oop> visitedOops = new HashSet<Oop>(); | |
public long getTotalSize() { | |
return totalSize; | |
} | |
public void reset() { | |
totalSize = 0L; | |
visitedOops.clear(); | |
} | |
// Called before visiting an object | |
public void prologue() { | |
visitedOops.add(getObj()); | |
totalSize += getObj().getObjectSize(); | |
} | |
// Called after visiting an object | |
public void epilogue() { | |
} | |
private Oop obj; | |
public void setObj(Oop obj) { this.obj = obj; } | |
// Returns the object being visited | |
public Oop getObj() { return obj; } | |
// Callback methods for each field type in an object | |
public void doOop(OopField field, boolean isVMField) { | |
Oop current = getObj(); | |
Oop oop = field.getValue(current); | |
if (oop != null && !visitedOops.contains(oop)) { | |
oop.iterate(this, false); | |
setObj(current); | |
} | |
} | |
public void doOop(NarrowOopField field, boolean isVMField) { | |
Oop current = getObj(); | |
Oop oop = field.getValue(current); | |
if (oop != null && !visitedOops.contains(oop)) { | |
oop.iterate(this, false); | |
setObj(current); | |
} | |
} | |
public void doByte(ByteField field, boolean isVMField) { | |
} | |
public void doChar(CharField field, boolean isVMField) { | |
} | |
public void doBoolean(BooleanField field, boolean isVMField) { | |
} | |
public void doShort(ShortField field, boolean isVMField) { | |
} | |
public void doInt(IntField field, boolean isVMField) { | |
} | |
public void doLong(LongField field, boolean isVMField) { | |
} | |
public void doFloat(FloatField field, boolean isVMField) { | |
} | |
public void doDouble(DoubleField field, boolean isVMField) { | |
} | |
public void doCInt(CIntField field, boolean isVMField) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pwd | |
/home/sajia/build/baseline-f0f676c5a2c6/agent/make | |
$ ./jsdbproc64.sh /home/sajia/jdk/6u25_x64/bin/java ~/experiment/test_array_gc/core.23346 | |
java version "1.6.0_25" | |
Java(TM) SE Runtime Environment (build 1.6.0_25-b06) | |
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode) | |
Attaching to core /home/sajia/experiment/test_array_gc/core.23346 from executable /home/sajia/jdk/6u25_x64/bin/java, please wait... | |
WARNING: Hotspot VM version 20.0-b11 does not match with SA version 20.0-b11-internal. You may see unexpected results. | |
Debugger attached successfully. | |
Server compiler detected. | |
JVM version is 20.0-b11 | |
jsdb> jvm.threads.toString() | |
[Thread (address=0x00000000ffcdc7a0, name=Low Memory Detector), Thread (address=0x00000000ffcdc670, name=C2 CompilerThread1), Thread (address=0x00000000ffcdc540, name=C2 CompilerThread0), Thread (address=0x00000000ffcdc410, name=Signal Dispatcher), Thread (address=0x00000000ffcb1320, name=Finalizer), Thread (address=0x00000000ffcb11e8, name=Reference Handler), Thread (address=0x00000000ffcb0840, name=main)] | |
jsdb> allThreads = jvm.threads | |
com.sun.script.javascript.JSAdapter@5328f6ee | |
jsdb> allThreads.toString() | |
[Thread (address=0x00000000ffcdc7a0, name=Low Memory Detector), Thread (address=0x00000000ffcdc670, name=C2 CompilerThread1), Thread (address=0x00000000ffcdc540, name=C2 CompilerThread0), Thread (address=0x00000000ffcdc410, name=Signal Dispatcher), Thread (address=0x00000000ffcb1320, name=Finalizer), Thread (address=0x00000000ffcb11e8, name=Reference Handler), Thread (address=0x00000000ffcb0840, name=main)] | |
jsdb> mainThread = allThreads[allThreads.length - 1] | |
com.sun.script.javascript.JSAdapter@3e110003 | |
jsdb> mainThreadFrames = mainThread.frames | |
com.sun.script.javascript.JSAdapter@65b60280 | |
jsdb> mainThreadFrames.toString() | |
[Frame (method=java.io.FileInputStream.readBytes(byte[], int, int), bci=0, line=0), Frame (method=java.io.FileInputStream.read(byte[], int, int), bci=4, line=220), Frame (method=java.io.BufferedInputStream.fill(), bci=175, line=218), Frame (method=java.io.BufferedInputStream.read(), bci=12, line=237), Frame (method=TestArrayGC.main(java.lang.String[]), bci=59, line=16)] | |
jsdb> mainFrame = mainThreadFrames[mainThreadFrames.length - 1] | |
com.sun.script.javascript.JSAdapter@538f1d7e | |
jsdb> mainFrame.toString() | |
Frame (method=TestArrayGC.main(java.lang.String[]), bci=59, line=16) | |
jsdb> mainFrame.locals | |
com.sun.script.javascript.JSAdapter@4e76fba0 | |
jsdb> mainFrame.locals.toString() | |
{} | |
jsdb> mainFrame.toString() | |
Frame (method=TestArrayGC.main(java.lang.String[]), bci=59, line=16) | |
jsdb> mainFrame.locals.length | |
jsdb> typeof mainFrame.locals | |
function | |
jsdb> classof(mainFrame.locals) | |
java.lang.Object@6581ed9e | |
jsdb> mainFrame.line | |
16 | |
jsdb> mainFrame.method.toString() | |
Method TestArrayGC.main(java.lang.String[]) | |
jsdb> mainFrame.thisObject | |
jsdb> mainFrame.locals == null | |
false | |
jsdb> mainFrame.locals.toString() | |
{} | |
jsdb> typeof mainFrame.locals | |
function | |
jsdb> for (i in sa) { println(i) } | |
interpreter | |
threads | |
codeCache | |
symTbl | |
systemDictionary | |
typedb | |
objHeap | |
cdbg | |
sysDict | |
dbg | |
heap | |
vm | |
symbolTable | |
jsdb> sa.vm | |
sun.jvm.hotspot.runtime.VM@15aaf0b3 | |
jsdb> sa.vm.universe.toString() | |
sun.jvm.hotspot.memory.Universe@9a082e2 | |
jsdb> sa.threads.toString() | |
sun.jvm.hotspot.runtime.Threads@8f0c85e | |
jsdb> t = sa.threads.first() | |
sun.jvm.hotspot.runtime.LowMemoryDetectorThread@0x0000000043874800 | |
jsdb> t = t.next() | |
sun.jvm.hotspot.runtime.CompilerThread@0x0000000043872800 | |
jsdb> t = t.next() | |
sun.jvm.hotspot.runtime.CompilerThread@0x000000004386c800 | |
jsdb> t = t.next() | |
sun.jvm.hotspot.runtime.JavaThread@0x000000004386a800 | |
jsdb> t.toString() | |
sun.jvm.hotspot.runtime.JavaThread@0x000000004386a800 | |
jsdb> t.threadName | |
Signal Dispatcher | |
jsdb> t = t.next() | |
sun.jvm.hotspot.runtime.JavaThread@0x0000000043849000 | |
jsdb> t.threadName | |
Finalizer | |
jsdb> t = t.next() | |
sun.jvm.hotspot.runtime.JavaThread@0x0000000043847000 | |
jsdb> t.threadName | |
Reference Handler | |
jsdb> t = t.next() | |
sun.jvm.hotspot.runtime.JavaThread@0x00000000437e2800 | |
jsdb> t.threadName | |
main | |
jsdb> fst = new sapkg.runtime.StackFrameStream(t) | |
sun.jvm.hotspot.runtime.StackFrameStream@3b75078b | |
jsdb> frm = fst.current | |
sp: 0x00000000403ec9d0, unextendedSP: 0x00000000403ec9d0, fp: 0x00000000403eca38, pc: 0x00002aaaab034b0c | |
jsdb> frm.toString() | |
sp: 0x00000000403ec9d0, unextendedSP: 0x00000000403ec9d0, fp: 0x00000000403eca38, pc: 0x00002aaaab034b0c | |
jsdb> fst.next(); fst.next(); fst.next(); fst.next() | |
jsdb> frm = fst.current | |
sp: 0x00000000403ecbb8, unextendedSP: 0x00000000403ecbb8, fp: 0x00000000403ecc00, pc: 0x00002aaaab02896e | |
jsdb> frm.isJavaFrame() | |
true | |
jsdb> frm.isInterpretedFrame() | |
true | |
jsdb> m.name | |
sun.jvm.hotspot.oops.Symbol@fa404228 | |
jsdb> m.name.toString() | |
sun.jvm.hotspot.oops.Symbol@fa404228 | |
jsdb> m.name.asString() | |
main | |
jsdb> intArrayOop = addr2oop(frm.addressOfInterpreterFrameLocal(1).getOopHandleAt(0)) | |
sun.jvm.hotspot.oops.TypeArray@ffce5af8 | |
jsdb> integerArrayEmptyOop = addr2oop(frm.addressOfInterpreterFrameLocal(2).getOopHandleAt(0)) | |
sun.jvm.hotspot.oops.ObjArray@ffd25b08 | |
jsdb> integerArrayFullOop = addr2oop(frm.addressOfInterpreterFrameLocal(3).getOopHandleAt(0)) | |
sun.jvm.hotspot.oops.ObjArray@ffd65b18 | |
jsdb> intArrayOop.objectSize | |
262160 | |
jsdb> integerArrayEmptyOop.objectSize | |
262160 | |
jsdb> integerArrayFullOop.objectSize | |
262160 | |
jsdb> intArrayOop.print() | |
[I @ 0x00000000ffce5af8 (object size = 262160) | |
- _mark: {0} :1 | |
- _metadata._compressed_klass: {8} :TypeArrayKlass for [I @ 0x00000000fa4012f0 | |
- 0: {16} :256 | |
- 1: {20} :257 | |
- 2: {24} :258 | |
... | |
- 65534: {262152} :65790 | |
- 65535: {262156} :65791 | |
jsdb> integerArrayEmptyOop.print() | |
ObjArray @ 0x00000000ffd25b08 (object size = 262160) | |
- _mark: {0} :1 | |
- _metadata._compressed_klass: {8} :ObjArrayKlass for InstanceKlass for java/lang/Integer @ 0x00000000fa67c368 | |
- 0: {16} :null | |
- 1: {20} :null | |
- 2: {24} :null | |
... | |
- 65534: {262152} :null | |
- 65535: {262156} :null | |
jsdb> integerArrayFullOop.print() | |
ObjArray @ 0x00000000ffd65b18 (object size = 262160) | |
- _mark: {0} :1 | |
- _metadata._compressed_klass: {8} :ObjArrayKlass for InstanceKlass for java/lang/Integer @ 0x00000000fa67c368 | |
- 0: {16} :Oop for java/lang/Integer @ 0x00000000ffce4ff8 | |
- 1: {20} :Oop for java/lang/Integer @ 0x00000000ffce5008 | |
- 2: {24} :Oop for java/lang/Integer @ 0x00000000ffce5018 | |
... | |
- 65534: {262152} :Oop for java/lang/Integer @ 0x00000000ffea5018 | |
- 65535: {262156} :Oop for java/lang/Integer @ 0x00000000ffea5028 | |
jsdb> sizeCollect = new Packages.fx.JavaObjectSizeCollector() | |
fx.JavaObjectSizeCollector@58d9660d | |
jsdb> intArrayOop.iterate(sizeCollect, false) | |
jsdb> sizeCollect.totalSize | |
262160 | |
jsdb> sizeCollect.reset() | |
jsdb> integerArrayEmptyOop.iterate(sizeCollect, false) | |
jsdb> sizeCollect.totalSize | |
262160 | |
jsdb> sizeCollect.reset() | |
jsdb> integerArrayFullOop.iterate(sizeCollect, false) | |
jsdb> sizeCollect.totalSize | |
1310736 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestArrayGC { | |
private static final int LENGTH = 0x10000; | |
public static void main(String[] args) throws Exception { | |
int[] intArray = new int[LENGTH]; | |
Integer[] integerArrayEmpty = new Integer[LENGTH]; | |
Integer[] integerArrayFull = new Integer[LENGTH]; | |
for (int i = 0; i < LENGTH; i++) { | |
int value = 256 + i; | |
intArray[i] = value; | |
integerArrayFull[i] = value; | |
} | |
// hold the process, wait for heap dump | |
System.in.read(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment