Hi, The number of byte[] instances and the total size shows that each byte[] is approx. 1024 bytes long. This is exactly the size used by RAMDirectory for allocated heap blocks. So the important question: Do you use RAMDirectory to hold your index? This is not recommended, it is better to use MMapDirectory. RAMDirectory is a class made for testing lucene, not for production (does not scale well, is not GC-friendly, and is therefore slow in most cases for large indexes). Also the index is not persisted to disk. If you want an in-memory index, use a linux tmpfs filesystem (ramdisk) and write your index to it (and use MMapDirectory to access it).
To help you, give more information on how you use Lucene and its directory implementations. Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: 308181687 [mailto:308181...@qq.com] > Sent: Friday, June 27, 2014 10:42 AM > To: java-user > Subject: About lucene memory consumption > > Hi, all > > > I fould that the memory consumption of my lucene server is abnormal, and > “jmap -histo ${pid}” show that the class of byte[] consume almost all of the > memory. Is there memory leak in my app? Why so many byte[] instances? > > > > > > > > > The following is the top output of jmap: > > > num #instances #bytes class name > ---------------------------------------------- > 1: 1786575 1831556144 [B > 2: 704618 80078064 [C > 3: 839932 33597280 java.util.LinkedHashMap$Entry > 4: 686770 21976640 java.lang.String > > > .... > > > > > > > > > Thanks & Best Regards! --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org