I'm experiencing a memory leak which I think I've traced to Query.rewrite().
I've attached a test case: when I run it, I see resident memory size
increasing (monitored with top), and "jmap -histo:live <pid>" from
a sample run shows the following top allocations:

 num     #instances         #bytes  class name
----------------------------------------------
   1:        200640        8025600  java.lang.String
   2:        200684        6525304  [C
   3:        197900        6332800  org.apache.lucene.index.Term
   4:        197900        6332800  org.apache.lucene.search.TermQuery

(I've noticed that TermQuery.rewrite() just returns "this".)

I'm running Ubuntu Hardy linux x86-64, java -showversion:
java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)

and pylucene r475 (locally built).

Does this reproduce for anyone?

   Thanks,
   Aaron Lav ([EMAIL PROTECTED])


import lucene
import sys
import os

def getReader(analyzer):
    store = lucene.RAMDirectory()
    writer = lucene.IndexWriter(store, analyzer, True)
    writer.close()
    return lucene.IndexSearcher(store).getIndexReader()
    

if __name__ == '__main__':
    env = lucene.initVM(classpath=lucene.CLASSPATH)
    analyzer = lucene.StandardAnalyzer()
    reader = getReader(analyzer)
    count = 0
    while 1:
        base_query = lucene.TermQuery(lucene.Term('all', 'foo'))
        new_query = base_query.rewrite(reader)
        count += 1
        if not count % 100:
            lucene.System.gc()

        

        
    
    
_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to