lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastin <>
Subject Java Heap Space -Out Of Memory Error
Date Tue, 04 Sep 2007 10:19:40 GMT

Hi All,
       i used to search 3 Lucene Index store of size 6 GB,10 GB,10 GB of
records using MultiReader class.

here is the following code snippet:

                                         Directory indexDir2 = 
                                         IndexReader indexSource2 =;
                                       Directory indexDir3 = 
                                         IndexReader indexSource3 =;
                                         Directory indexDir4 = 
                                         IndexReader indexSource4 =; 
        IndexReader[] readArray = {indexSource2,indexSource3,indexSource4};
        //merged reader
        IndexReader mergedReader = new MultiReader(readArray);
        IndexSearcher is = new IndexSearcher(mergedReader);
                                 QueryParser parser = 
                                     new QueryParser("contents" ,new
                                String searchQuery= 
StringBuffer().append(inputNo).append(" AND dateSc:["
).append(fromDate).append(" TO ").append(toDate).append("]").append("
").append("AND").append(" ").append(callTyp).toString();
                                 Query callDetailquery =
                                 hits =; 

it takes 300 MB of RAM for every search and it is very very slow is there
any other way to control the Memory and to make search faster.i use
SINGLETON  to use the IndexSearcher as a one time used object for all the
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message