Bugs item #987142, was opened at 2004-07-08 12:33
Message generated for change (Comment added) made by shtroodle
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=491356&aid=987142&group_id=59548

Category: searcher
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Shtroodle (shtroodle)
Assigned to: Doug Cutting (cutting)
Summary: Read handler leak

Initial Comment:
In the class net.nutch.searcher.IndexSearcher
constructor:
public IndexSearcher(File[] segmentDirs) throws IOException

In line 50: there is allocation of this.luceneSearcher as

this.luceneSearcher = new MultiSearcher(searchables);

The constructor of MultiSearcher allocates segment
readers for each segment in the segments directory.
Allocation of the reader opens a handler on the
segments' directories. All these handlers should be
releaseed when the MultiSearcher becomes obsolete.
There is MultiSearcher.close() method that does it.

However, IndexSearcher does not call the method
anywhere  also it doesn't have any close method that
calls this.luceneSearcher.close().
 
Hence any creation  of IndexSearcher  creates a number
of handlers on the segments directories that are never
released (only when the process is finished).

Possible solution:
 add a close() method to all searchers in the Nutch
project.

----------------------------------------------------------------------

>Comment By: Shtroodle (shtroodle)
Date: 2004-07-12 18:42

Message:
Logged In: YES 
user_id=1079314

I have found another handle leak in IndexSegment class.
Here is the patch for both bugs. I also did some imports
cleanup. 
The bottom line is that: 4 classes have been changed
(NutchBean, FetchedSegments, IndexSearcher, IndexSegment )
and one interface, Closeable, has been added to
net.nutch.util package.
The files differences are attached.


----------------------------------------------------------------------

Comment By: Shtroodle (shtroodle)
Date: 2004-07-12 09:12

Message:
Logged In: YES 
user_id=1079314

There is no problem for me to prepare the patch. I would
like to research it a little bit more to find a better
solution.  Hopefuly, it will be done till the end of the
week. Whom can I ask administration questions?

----------------------------------------------------------------------

Comment By: Shtroodle (shtroodle)
Date: 2004-07-11 18:18

Message:
Logged In: YES 
user_id=1079314

There is no problem for me to prepare the patch. I would
like to research it a little bit more to find a better
solution.  Hopefuly, it will be done till the end of the
week. Whom can I ask administration questions?

----------------------------------------------------------------------

Comment By: Doug Cutting (cutting)
Date: 2004-07-08 23:08

Message:
Logged In: YES 
user_id=21778

The file handles will be released when the searcher is
garbage collected, but that is not optimal.  It would indeed
be better to have a close() method on Nutch's IndexSearcher,
HitDetailer, HitSummarizer, and HitContent.  Since NutchBean
implements all of these, the close method should probably be
in its own interface, perhaps a Closeable interface in the
util package?

Would you like to prepare a patch for this?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=491356&aid=987142&group_id=59548


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nutch-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to