lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From testn <te...@doramail.com>
Subject Re: Java Heap Space -Out Of Memory Error
Date Tue, 04 Sep 2007 11:36:29 GMT

I think you store dateSc with full precision i.e. with time. You should
consider to index it just date part or to the resolution you really need. It
should reduce the memory it use when constructing DateRangeQuery and plus it
will improve search performance as well.



Sebastin wrote:
> 
> 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 = 
>                       FSDirectory.getDirectory(indexSourceDir02,false);
>                                          IndexReader indexSource2 =
> IndexReader.open(indexDir2);
>                                        Directory indexDir3 = 
>                                             
> FSDirectory.getDirectory(indexSourceDir03,false);
>                                          IndexReader indexSource3 =
> IndexReader.open(indexDir3);
>                                          Directory indexDir4 = 
>                                             
> FSDirectory.getDirectory(indexSourceDir04,false);
>                                          IndexReader indexSource4 =
> IndexReader.open(indexDir4); 
>                                         
>            
>                                          
>         IndexReader[] readArray =
> {indexSource2,indexSource3,indexSource4};
>         //merged reader
>         IndexReader mergedReader = new MultiReader(readArray);
>         IndexSearcher is = new IndexSearcher(mergedReader);
>         
>                                 
>                                  QueryParser parser = 
>                                      new QueryParser("contents" ,new
> StandardAnalyzer());
>                                  
>                                  
>                                 String searchQuery= 
>                                        new
> StringBuffer().append(inputNo).append(" AND dateSc:["
> ).append(fromDate).append(" TO ").append(toDate).append("]").append("
> ").append("AND").append(" ").append(callTyp).toString();
>                                    
>                                  
>                                  
>                                  Query callDetailquery =
> parser.parse(searchQuery);
>                                  
>                                  hits = is.search(callDetailquery); 
> 
> 
> 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
> instances.
> 

-- 
View this message in context: http://www.nabble.com/Java-Heap-Space--Out-Of-Memory-Error-tf4376803.html#a12476392
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message