From java-dev-return-46502-apmail-lucene-java-dev-archive=lucene.apache.org@lucene.apache.org Mon Feb 08 20:59:52 2010 Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 30027 invoked from network); 8 Feb 2010 20:59:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2010 20:59:52 -0000 Received: (qmail 7503 invoked by uid 500); 8 Feb 2010 20:59:51 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 7404 invoked by uid 500); 8 Feb 2010 20:59:51 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 7396 invoked by uid 99); 8 Feb 2010 20:59:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 20:59:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 20:59:49 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 103BF29A0021 for ; Mon, 8 Feb 2010 12:59:28 -0800 (PST) Message-ID: <1404230388.131261265662768065.JavaMail.jira@brutus.apache.org> Date: Mon, 8 Feb 2010 20:59:28 +0000 (UTC) From: "Jason Rutherglen (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2255) IndexWriter.getReader() allocates file handles In-Reply-To: <1592971836.129561265659168277.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-2255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831116#action_12831116 ] Jason Rutherglen commented on LUCENE-2255: ------------------------------------------ bq. What keeps you from attaching a patch for the IW javadoc? Laziness and lack of motivation... :) I'll post something to the issue, how's that? > IndexWriter.getReader() allocates file handles > ---------------------------------------------- > > Key: LUCENE-2255 > URL: https://issues.apache.org/jira/browse/LUCENE-2255 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Environment: Ubuntu 9.10, Java 6 > Reporter: Mikkel Kamstrup Erlandsen > Attachments: LuceneManyCommits.java > > > I am not sure if this is a "bug" or really just me not reading the Javadocs right... > The IR returned by IW.getReader() leaks file handles if you do not close() it, leading to starvation of the available file handles/process. If it was clear from the docs that this was a *new* reader and not some reference owned by the writer then this would probably be ok. But as I read the docs the reader is internally managed by the IW, which at first shot lead me to believe that I shouldn't close it. > So perhaps the docs should be amended to clearly state that this is a caller-owns reader that *must* be closed? Attaching a simple app that illustrates the problem. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org