You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Karl Wettin (JIRA)" <ji...@apache.org> on 2007/03/15 22:38:09 UTC

[jira] Commented: (LUCENE-829) StandardBenchmarker#makeDocument does not explicitly close opened files

    [ https://issues.apache.org/jira/browse/LUCENE-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481330 ] 

Karl Wettin commented on LUCENE-829:
------------------------------------

This is also true for ReutersDocMaker:

    StringBuffer bodyBuf = new StringBuffer(1024);
    while ((line = reader.readLine()) != null) {
      bodyBuf.append(line).append(' ');
    }
+    reader.close();



> StandardBenchmarker#makeDocument does not explicitly close opened files
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-829
>                 URL: https://issues.apache.org/jira/browse/LUCENE-829
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Karl Wettin
>
> StandardBenchmarker#makeDocument(File in, String[] tags, boolean stored, boolean tokenized, boolean tfv)
>         BufferedReader reader = new BufferedReader(new FileReader(in));
> Above reader is not closed until GC hits it. Can cause problems in cases where ulimit is set too low.
> I did this:
>         while ((line = reader.readLine()) != null)
>         {
>             body.append(line).append(' ');
>         }
> +        reader.close();

-- 
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