• Post Reply Bookmark Topic Watch Topic
  • New Topic

Try to understand the memory usage of trace ID 300000 in HRPOF file  RSS feed

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried to use hprof paramter to get the HPROF for memory usage checking. The command is like below. (I used the simple sample code for testing)

java -Xrunhprof:heap=all,cpu=old,depth=6 test/com/timerTest


I got the hprof file. Based on trace ID, some trace id is very clear and useful. Based on the traceID , like 301586, I can see exact line which spend the memory , like


5066 TRACE 301586:
5067 java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:63)
5068 java.lang.StringBuilder.<init>(StringBuilder.java:85)
5069 test.com.timerTest.main(timerTest.java:14)




but some of memory usage with trace id 300000, I can not find the valuable information for the memory usage from hprof file, It just marked as empty, and I don't know what exactly means for those memory usage , and which part is using that.

I attached the source and the hrpof file in the thread. Also I list the sumary of hprof file and some trace id 3000000 below.

I hope to understand , what is the memoryt usage for trace ID 300000, and how it involves the memory usage.

Does someone know how we can find tracce 300000 memory usage?




TRACE 300000:
<empty>
.............
ROOT 0 (kind=<thread>, id=200000, trace=300000)
ROOT 50000c6a (kind=<thread>, id=200003, trace=300001)
ROOT 50000c6a (kind=<thread block>, thread=200003)
ROOT 50000c73 (kind=<thread>, id=200004, trace=300000)
ROOT 50000c73 (kind=<thread block>, thread=200004)
ROOT 50000c73 (kind=<JNI local ref>, thread=200000, frame=0)
ROOT 50000c74 (kind=<thread>, id=200005, trace=300000)CLS 5001b4bd (name=javax.lang.model.element.VariableElement[], trace=300000)
super 50000119
CLS 5001b4be (name=javax.lang.model.element.Element[], trace=300000)
super 50000119

................

SITES BEGIN (ordered by live bytes) Tue Mar 15 14:07:10 2016
percent live alloc'ed stack class
rank self accum bytes objs bytes objs trace name
1 16.76% 16.76% 131200 8 131200 8 300827 char[]
2 10.52% 27.29% 82336 861 82336 861 300000 char[]
3 8.39% 35.68% 65664 8 65664 8 300815 byte[]
4 3.26% 38.94% 25536 9 25536 9 300000 byte[]
5 2.68% 41.62% 20960 134 20960 134 300039 char[]
6 2.67% 44.28% 20864 847 20864 847 300000 java.lang.String
7 1.67% 45.95% 13040 302 13040 302 300000 java.lang.Object[]
8 1.55% 47.50% 12144 109 12144 109 300048 char[]
9 1.51% 49.01% 11832 66 11832 66 300084 byte[]
10 0.95% 49.96% 7440 121 7440 121 300919 char[]
11 0.74% 50.71% 5808 11 5808 11 300769 byte[]
12 0.62% 51.33% 4848 66 4848 66 300087 byte[]
13 0.55% 51.87% 4272 178 4272 178 300934 java.util.LinkedList$Node
14 0.55% 52.42% 4272 117 4272 117 300000 java.util.Hashtable$Entry
15 0.51% 52.92% 3960 28 3960 28 300298 char[]
16 0.49% 53.42% 3872 121 3872 121 300375 java.util.HashMap$Entry
17 0.46% 53.88% 3600 77 3600 77 300000 java.lang.ref.SoftReference
18 0.45% 54.33% 3552 25 3552 25 300292 char[]
19 0.43% 54.76% 3376 11 3376 11 300770 byte[]








Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!