Hello..

I think you might be referring to the close method not present in catch method. if that's so, that is purposely done for the time being...

Else if the execution happens properly, then the flow won't go to catch as of now. Obviously the close will be present both in catch and finally block.

But I don't think this is possibly the root of this problem.

There seems to be another problem which is causing this issue..Would appreciate some guidance..

On 9/2/2013 12:11 PM, Trejkaz wrote:
On Mon, Sep 2, 2013 at 4:10 PM, Ankit Murarka
<ankit.mura...@rancoretech.com>  wrote:
There's a reason why Writer is being opened everytime inside a while loop. I
usually open writer in main method itself as suggested by you and pass a
reference to it. However what I have observed is that if my file contains
more than 4 lakh lines, the writer.add(doc) line does not execute and throws
an OutOfMemoryError although JVM is provided with enough heap.
The problem isn't opening it multiple times (although that does seem
unnecessary too), the problem is that half the time you're not closing
it.

Try refactoring to always use the try(){} syntax so that all your
Closeable objects are being closed properly. You'll find all sorts of
issues with the code you posted.

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org




--
Regards

Ankit Murarka

"What lies behind us and what lies before us are tiny matters compared with what 
lies within us"


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to