tags:

views:

70

answers:

1

I was curious about the runhprof output? I am mainly concerned about the memory section. It looks like there are multiple entries of the same class. Why would that be.

Is there a way to get hprof to print how much memory a particular class(the instances of that class) take up in memory. One value for each class.

Also, what tools do you use beside 'hat' to analyze the output?

I ran the java command with jvm arg:

-Xrunhprof:heap=sites,depth=4,format=a,file=prof/hprof_dump.txt

Here is brief snippet of the output. Some classes are listed multiple times in the output.

SITES BEGIN (ordered by live bytes) Tue Jul 28 19:33:41 2009
          percent          live          alloc'ed  stack class
 rank   self  accum     bytes objs     bytes  objs trace name
    1 29.75% 29.75%    700080 43755 576000016 36000001 307483 java.lang.Double
      2  7.13% 36.88%    167840 5245    370432 11576 300993 clojure.lang.PersistentHashMap$LeafNode
        3  2.09% 38.98%     49296 2054     60048  2502 301295 clojure.lang.Symbol
        4  2.09% 41.07%     49200    3     49200     3 301071 char[]
        5  1.33% 42.40%     31344 1306     68088  2837 300998 clojure.lang.PersistentHashMap$BitmapIndexedNode
        6  1.10% 43.50%     25800  645     25800   645 301050 clojure.lang.Var
        7  1.05% 44.54%     24624    3     24624     3 301069 byte[]
        8  0.86% 45.40%     20184  841     49608  2067 301003 clojure.lang.PersistentHashMap$INode[]
        9  0.78% 46.18%     18304  572     58720  1835 301308 clojure.lang.PersistentList
       10  0.75% 46.93%     17568  549     17568   549 308832 java.lang.String[]
       11  0.70% 47.62%     16416    2     16416     2 301036 byte[]
+2  A: 

Eclipse Memory Analyzer is excellent. Loads the dump file up very very quickly, produces lots of nice reports about the heapdump, lets you query the dump for objects/classes using a SQL-like language. Love it.

matt b
the dump file or the file created from hprof.
Berlin Brown
Should be the same thing.
matt b
Yep, I just ran it. Freaking perfect. Thanks.Works with heap dumps from 1.5 also.
Berlin Brown