Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 68677 invoked from network); 10 Dec 2004 17:23:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Dec 2004 17:23:44 -0000 Received: (qmail 54884 invoked by uid 500); 10 Dec 2004 17:23:25 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 54823 invoked by uid 500); 10 Dec 2004 17:23:24 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 54802 invoked by uid 99); 10 Dec 2004 17:23:23 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of greenlion@gmail.com designates 64.233.170.207 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.207) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 10 Dec 2004 09:23:16 -0800 Received: by rproxy.gmail.com with SMTP id 1so277296rny for ; Fri, 10 Dec 2004 09:23:04 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=XM5wQ8ynpvhl/p1wbqI9lo/Vv7SIQbAjcbYYSPgEVIQRsVl8gHhBA2ezjyhInYt7KGRuq6BkSy6RbCHa1wgQQRyilBv82w87LhKNYJTx7uK4HWiONdKgCD++xzVAzRJA2Dp5XDeCpR3JxjRD9+3tI5cCitRvZJbiq3zkDVmQdWE= Received: by 10.38.206.19 with SMTP id d19mr632851rng; Fri, 10 Dec 2004 09:23:04 -0800 (PST) Received: by 10.38.179.4 with HTTP; Fri, 10 Dec 2004 09:23:04 -0800 (PST) Message-ID: Date: Fri, 10 Dec 2004 10:23:04 -0700 From: Justin Swanhart Reply-To: Justin Swanhart To: Lucene Users List Subject: Re: OutOfMemoryError with Lucene 1.4 final In-Reply-To: <91B8D84A21EFD746B9191AC1CFD66549A8902E@exbecg01.Interwoven.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <91B8D84A21EFD746B9191AC1CFD66549A8902E@exbecg01.Interwoven.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N You probably need to increase the amount of RAM available to your JVM. See the parameters: -Xmx :Maximum memory usable by the JVM -Xms :Initial memory allocated to JVM My params are; -Xmx2048m -Xms128m (2G max, 128M initial) On Fri, 10 Dec 2004 11:17:29 -0600, Sildy Augustine wrote: > I think you should close your files in a finally clause in case of > exceptions with file system and also print out the exception. > > You could be running out of file handles. > > > > -----Original Message----- > From: Jin, Ying [mailto:yingjin@indiana.edu] > Sent: Friday, December 10, 2004 11:15 AM > To: lucene-user@jakarta.apache.org > Subject: OutOfMemoryError with Lucene 1.4 final > > 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 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org