lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jin, Ying" <ying...@indiana.edu>
Subject OutOfMemoryError with Lucene 1.4 final
Date Fri, 10 Dec 2004 17:14:40 GMT
Hi, Everyone,

 

We're trying to index ~1500 archives but get OutOfMemoryError about
halfway through the index process. I've tried to run program under two
different Redhat Linux servers: One with 256M memory and 365M swap
space. The other one with 512M memory and 1G swap space. However, both
got OutOfMemoryError at the same place (at record 898). 

 

Here is my code for indexing:

===============================================

    Document doc = new Document();

    doc.add(Field.UnIndexed("path", f.getPath()));

    doc.add(Field.Keyword("modified",

 
DateField.timeToString(f.lastModified())));

    doc.add(Field.UnIndexed("eprintid", id));

    doc.add(Field.Text("metadata", metadata));

 

    FileInputStream is = new FileInputStream(f);  // the text file

    BufferedReader reader = new BufferedReader(new
InputStreamReader(is));

 

    StringBuffer stringBuffer = new StringBuffer();

    String line = "";

    try{

      while((line = reader.readLine()) != null){

        stringBuffer.append(line);

      }

      doc.add(Field.Text("contents", stringBuffer.toString()));

      // release the resources

      is.close();

      reader.close();

}catch(java.io.IOException e){}

=================================================

Is there anything wrong with my code or I need more memory?

 

Thanks for any help!

Ying


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message