To do this analysis use -prof option, like below.
F:\JavaSamples>java -prof Test
Hello World!
Dumping CPU usage in old prof format ... done.
F:\JavaSamples>dir
After running java application, The JVM dumps the each part of code / api calls into a seperate file named java.prof
java.prof:
count callee caller time
1375 java.lang.AbstractStringBuilder.ensureCapacityInternal(I)V java.lang.AbstractStringBuilder.append(C)Ljava/lang/AbstractStringBuilder; 0
1306 java.lang.String.charAt(I)C java.lang.String$CaseInsensitiveComparator.compare(Ljava/lang/String;Ljava/lang/String;)I 15
759 java.io.WinNTFileSystem.isSlash(C)Z java.io.WinNTFileSystem.normalize(Ljava/lang/String;II)Ljava/lang/String; 0
759 java.lang.String.charAt(I)C java.io.WinNTFileSystem.normalize(Ljava/lang/String;II)Ljava/lang/String; 0
755 java.lang.CharacterDataLatin1.getProperties(I)I java.lang.CharacterDataLatin1.toLowerCase(I)I 0
755 java.lang.CharacterDataLatin1.toLowerCase(I)I java.lang.Character.toLowerCase(I)I 0
..
F:\JavaSamples>java -prof Test
Hello World!
Dumping CPU usage in old prof format ... done.
F:\JavaSamples>dir
After running java application, The JVM dumps the each part of code / api calls into a seperate file named java.prof
java.prof:
count callee caller time
1375 java.lang.AbstractStringBuilder.ensureCapacityInternal(I)V java.lang.AbstractStringBuilder.append(C)Ljava/lang/AbstractStringBuilder; 0
1306 java.lang.String.charAt(I)C java.lang.String$CaseInsensitiveComparator.compare(Ljava/lang/String;Ljava/lang/String;)I 15
759 java.io.WinNTFileSystem.isSlash(C)Z java.io.WinNTFileSystem.normalize(Ljava/lang/String;II)Ljava/lang/String; 0
759 java.lang.String.charAt(I)C java.io.WinNTFileSystem.normalize(Ljava/lang/String;II)Ljava/lang/String; 0
755 java.lang.CharacterDataLatin1.getProperties(I)I java.lang.CharacterDataLatin1.toLowerCase(I)I 0
755 java.lang.CharacterDataLatin1.toLowerCase(I)I java.lang.Character.toLowerCase(I)I 0
..
No comments :
Post a Comment