FANDOM


Here are some steps taken from the sun/oracle docs on troubleshooting and profiling Java apps


Get the memory usage and garbage colletion statistics;

# jstat -gcutil 17568 1000 10

 S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
 0.00  50.00  13.58  88.43  85.99  11471   42.963    17   11.971   54.935
70.00   0.00  10.01  88.44  85.99  11472   42.967    17   11.971   54.939
70.00   0.00  67.45  88.44  85.99  11472   42.967    17   11.971   54.939
75.00   0.00  13.88  88.47  85.99  11474   42.975    17   11.971   54.946
 0.00  76.95  28.59  88.48  85.99  11475   42.979    17   11.971   54.951
70.00   0.00   4.33  88.49  85.99  11476   42.983    17   11.971   54.955
70.00   0.00  86.49  88.49  85.99  11476   42.983    17   11.971   54.955
70.00   0.00 100.00  88.49  85.99  11476   42.983    17   11.971   54.955
 0.00  40.00  16.60  88.51  85.99  11477   42.987    17   11.971   54.959
 0.00  40.00  70.96  88.51  85.99  11477   42.987    17   11.971   54.959


Obtain a Heap histogram;

  1. jmap -histo 17568 | head -20
num     #instances         #bytes  class name

  1:        316068       31125968  [C
  2:        142850       21755896  <constMethodKlass>
  3:        142850       19439328  <methodKlass>
  4:         34821       16993104  [I
  5:         14610       16178632  <constantPoolKlass>
  6:         38242       13747016  [B
  7:        212620       11774160  <symbolKlass>
  8:        353906       11324992  java.lang.String
  9:         14610       11215064  <instanceKlassKlass>
 10:         12537        9522248  <constantPoolCacheKlass>
 11:        174539        9191480  [Ljava.lang.Object;
 12:        102838        9049744  java.lang.reflect.Method
 13:        141234        5649360  java.util.concurrent.ConcurrentHashMap$Segment
 14:         54505        4676840  [Ljava.util.HashMap$Entry;
 15:        141643        4532576  java.util.concurrent.locks.ReentrantLock$NonfairSync
 16:        165075        3961800  java.util.ArrayList
 17:          6465        3909728  <methodDataKlass>


# jmap -histo:live 17568 | head -20

num     #instances         #bytes  class name

  1:        302554       27727016  [C
  2:        142850       21755896  <constMethodKlass>
  3:        142850       19439328  <methodKlass>
  4:         14610       16178632  <constantPoolKlass>
  5:         33941       14205632  [I
  6:        212620       11774160  <symbolKlass>
  7:         14610       11215064  <instanceKlassKlass>
  8:        346017       11072544  java.lang.String
  9:         34546       10609552  [B
 10:         12537        9522248  <constantPoolCacheKlass>
 11:        172869        9096312  [Ljava.lang.Object;
 12:        102838        9049744  java.lang.reflect.Method
 13:        138658        5546320  java.util.concurrent.ConcurrentHashMap$Segment
 14:         53925        4634984  [Ljava.util.HashMap$Entry;
 15:        139055        4449760  java.util.concurrent.locks.ReentrantLock$NonfairSync
 16:        164388        3945312  java.util.ArrayList
 17:          6465        3909728  <methodDataKlass>

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.