Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 80909 invoked from network); 13 Sep 2004 13:52:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Sep 2004 13:52:35 -0000 Received: (qmail 23462 invoked by uid 500); 13 Sep 2004 13:52:08 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 23381 invoked by uid 500); 13 Sep 2004 13:52:07 -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 23350 invoked by uid 99); 13 Sep 2004 13:52:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [195.47.73.164] (HELO msx-na-server.forrest.local) (195.47.73.164) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 13 Sep 2004 06:52:04 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Subject: RE: OutOfMemory example Date: Mon, 13 Sep 2004 15:52:23 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: OutOfMemory example Thread-Index: AcSZlSgEpqroea1ETqeBI0WBhcnrqgAASy2A From: =?iso-8859-2?B?Smn47SBLdWhu?= To: "Lucene Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I disagree or I don't understand.=20 I can change the code as it is shown below. Now I must reopen the index = to see the changes, but the memory problem remains. I realy don't know = what I'm doing wrong, the code is so simple. Jiri. ... public static void main(String[] args) throws IOException { Directory directory =3D create_index(); for (int i =3D 1; i < 100; i++) { System.err.println("loop " + i + ", index version: " + = IndexReader.getCurrentVersion(directory)); search_index(directory); add_to_index(directory, i); } } private static void add_to_index(Directory directory, int i) throws = IOException { IndexWriter writer =3D new IndexWriter(directory, new = StandardAnalyzer(), false); SimpleDateFormat df =3D new SimpleDateFormat("yyyy-MM-dd"); Document doc =3D new Document(); doc.add(Field.Keyword("date", df.format(new = Date(System.currentTimeMillis())))); doc.add(Field.Keyword("id", "CD" + String.valueOf(i))); doc.add(Field.Text("text", "Tohle neni text " + i)); writer.addDocument(doc); System.err.println("index size: " + writer.docCount()); writer.close(); } ... -----Original Message----- From: John Moylan [mailto:johnm@rte.ie] Sent: Monday, September 13, 2004 3:25 PM To: Lucene Users List Subject: Re: OutOfMemory example You should reuse your old index (as eg an application variable) unless=20 it has changed - use getCurrentVersion to check the index for updates.=20 This has come up before. John --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org