Is there anything else in this JRE?

65 MB ought to be plenty for what you are trying to do w/ just Lucene,
I think.

Though to differentiate whether "you are not giving enough RAM to
Lucene" vs "you truly have a memory leak", you should try increasing
the heap size to something absurdly big (256 MB?), then see if you can
get the OOME again.  If you do get OOME then it's a real leak, and I
think next step after that is to get a heap dump to see what's using
all the RAM.

Mike

Chetan Shah wrote:


I am using the default heap size which according to Netbeans is around 65MB.

If the RAM directory was not initialized correctly, how am I getting valid search results? I am able to execute searches for quite some time before I
get OOME.

Makes Sense? Or Maybe I am missing something, please let me know.



Matthew Hall-7 wrote:

Perhaps this is a simple question, but looking at your stack trace, I'm
not seeing where it was set during the tomcat initialization, so here
goes:

Are you setting up the jvm's heap size during your Tomcat initialization
somewhere?

If not, that very well could be part of your issue, as the standard JVM
heapsize varies from platform to platform, so your windows based
installation of tomcat simply might not have enough JVM Heap available
to completely instantiate your RAMDirectory.

So, to start what is your heap currently set at for tomcat?

Secondly, if you try to increase it to a more reasonable value (say 512M
or 1G) do you still run into this issue?

Matt

Chetan Shah wrote:
The stack trace is attached.
http://www.nabble.com/file/p22667542/dump dump


The file size of
_30.cfx - 1462KB
_32.cfs - 3432KB
_30.cfs - 645KB


The source code of WatchListHTMLUtilities.getHTMLTitle is as follows :

                File f = new File(htmlFileName);
                FileInputStream fis = new FileInputStream(f);
org.apache.lucene.demo.html.HTMLParser parser = new HTMLParser(fis);
                String title = parser.getTitle();
                fis.close();
                fis = null;
                f = null;
                return title;





Michael McCandless-2 wrote:

Hmm... after how many queries do you see the crash?

Can you post the full OOME stack trace?

You're using a RAMDirectory to hold the entire index... how large is
your index?

Mike

Chetan Shah wrote:


After reading this forum post :
http://www.nabble.com/Lucene-Memory-Leak-tt19276999.html#a19364866

I created a Singleton For Standard Analyzer too. But the problem still
persists.

I have 2 singletons now. 1 for Standard Analyzer and other for
IndexSearcher.

The code is as follows :

package watchlistsearch.core;

import java.io.IOException;

import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;

import watchlistsearch.utils.Constants;

public class IndexSearcherFactory {
        
        private static IndexSearcherFactory instance = null;
        
        private IndexSearcher indexSearcher;
        
        private IndexSearcherFactory() {
                
        }
        
        public static IndexSearcherFactory getInstance() {
                
                if (IndexSearcherFactory.instance == null) {                    
                        IndexSearcherFactory.instance = new 
IndexSearcherFactory();             
                }
                
                return IndexSearcherFactory.instance;   
                
        }
        
        public IndexSearcher getIndexSearcher() throws IOException {
                
                if (this.indexSearcher == null) {                       
Directory directory = new RAMDirectory(Constants.INDEX_DIRECTORY);
                        indexSearcher = new IndexSearcher(directory);           
                                
                }
                
                return this.indexSearcher;              
        }
                        
}



package watchlistsearch.core;

import java.io.IOException;

import org.apache.log4j.Logger;
import org.apache.lucene.analysis.standard.StandardAnalyzer;


---------------------------------------------------------------

public class AnalyzerFactory {
        
        private static AnalyzerFactory instance = null;
        
        private StandardAnalyzer standardAnalyzer;
        
        Logger logger = Logger.getLogger(AnalyzerFactory.class);
        
        private AnalyzerFactory() {
                
        }
        
        public static AnalyzerFactory getInstance() {
                
                if (AnalyzerFactory.instance == null) {                 
                        AnalyzerFactory.instance = new AnalyzerFactory();       
        
                }
                
                return AnalyzerFactory.instance;        
                
        }
        
public StandardAnalyzer getStandardAnalyzer() throws IOException {
                
                if (this.standardAnalyzer == null) {
                        this.standardAnalyzer = new StandardAnalyzer();
                        logger.debug("StandardAnalyzer Initialized..");
                        
                }
                
                return this.standardAnalyzer;           
        }
                        
}

--
View this message in context:
http://www.nabble.com/Memory-Leak--tp22663917p22666121.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


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








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




--
View this message in context: 
http://www.nabble.com/Memory-Leak--tp22663917p22668265.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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



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

Reply via email to