You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sebastin <se...@gmail.com> on 2007/10/26 11:16:37 UTC

Re: Java Heap Space -Out Of Memory Error

Hi All,
       is it now possible to release the memory after every search in lucene
for 50 GB of records.

testn wrote:
> 
> 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#a13423503
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