Skip to main content

Memory Leak - How to get more info on Java Heap

1 reply [Last post]
chinhong
Offline
Joined: 2008-03-26
Points: 0

Using Jconsole, we noticed that the heap space for our production application fluctuates between 1G and 2G. It used to fluctuates between 300M to 800M when we have 1G allocated to JVM, now we have 3G allocated to it.

We used "jmap -histo" to get a dump of the heap space and it seems that most of the memory are allocated to char[] and byte[].- almost 600M.

How do we find out which classes allocate these char[] and byte[]? Iis there any other tools we can use to get a more detailed heap dump to help us figure out if we have memory leak?

Here is the heap histogram:

Object Histogram:

Size Count Class description
-------------------------------------------------------
396488304 583718 char[]
223026872 116451 byte[]
22314800 557870 java.lang.String
17478240 108916 * ConstMethodKlass
13372800 167160 org.apache.tomcat.util.buf.MessageBytes
11940664 10009 * ConstantPoolKlass
11804096 184439 org.apache.tomcat.util.buf.ByteChunk
11335328 108916 * MethodKlass
11157560 72535 java.util.HashMap$Entry[]
10337592 102146 int[]
9763320 174345 org.apache.tomcat.util.buf.CharChunk
8242320 68478 java.lang.Object[]
7164416 8619 * ConstantPoolCacheKlass
7080272 10009 * InstanceKlassKlass
6729200 133098 * SymbolKlass
4999776 104162 java.util.HashMap$Entry
4647528 8535 * MethodDataKlass
3935744 61496 java.util.HashMap
3199008 133292 java.lang.Long
2968720 47064 java.lang.String[]
2519040 78720 bce.friartuck.beans.CountryBean
2222304 7199 java.util.Hashtable$Entry[]
2036496 36366 java.lang.ref.SoftReference
2033600 50840 java.util.ArrayList
1883552 10702 java.lang.Class
1690696 11123 java.lang.reflect.Method
1640064 34168 org.apache.tomcat.util.http.MimeHeaderField
1622976 33812 java.util.Hashtable$Entry
1509160 37729 org.apache.lucene.index.TermInfo
1316432 14656 java.lang.Object[]
1206624 37707 org.apache.lucene.index.Term
1204736 5792 java.text.DecimalFormat
1070464 12664 short[]
1037952 21624 sun.misc.CacheEntry
1030776 42949 java.lang.Integer
1025904 21373 antlr.ANTLRHashString
985464 13687 org.apache.tomcat.util.http.ServerCookie
960096 20002 java.lang.ref.WeakReference
926344 1721 long[]
885248 5824 java.util.GregorianCalendar
823896 11443 java.util.WeakHashMap$Entry
776592 10786 bce.lib.search.CandidateProfile$WorkHistory
699240 5827 sun.util.calendar.Gregorian$Date
664896 6926 java.beans.MethodDescriptor
605544 3291 java.net.SocksSocketImpl
596960 10660 org.dom4j.QName

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fuzzyman
Offline
Joined: 2008-03-27
Points: 0