lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From findbestopensource <findbestopensou...@gmail.com>
Subject Re: old fashioned....."Too many open files"!
Date Fri, 18 May 2012 05:37:07 GMT
Post complete code. You are not closing the objects (IndexWriter / Index
Searcher) properly.

Regards
Aditya
www.findbestopensource.com


On Fri, May 18, 2012 at 6:51 AM, Michel Blase <mblase23@gmail.com> wrote:

> Hi all,
>
> I have few problems Indexing. I keep hitting "Too many open files". It
> seems like Lucene is not releasing files handlers after deleting segments.
>
> This is a piece from the lsof output showing the problem:
>
>
> java    23024 root *347r      REG      251,0     2660 149376
> /home/INDEXES_ROOT/SMPL_1/_bvq.cfs (deleted)
> java    23024 root *348r      REG      251,0     2477 149382
> /home/INDEXES_ROOT/SMPL_1/_bvr.cfs (deleted)
> java    23024 root *349r      REG      251,0     2747 149392
> /home/INDEXES_ROOT/SMPL_1/_bvu.cfs (deleted)
> java    23024 root *350r      REG      251,0     2339 149384
> /home/INDEXES_ROOT/SMPL_1/_bvs.cfs (deleted)
>
> and this is the code I'm using (I'm using Lucene3.6)
>
> -- IndexWriter creation:
>
> File app = new File(path);
> Directory dir = FSDirectory.open(app);
> IndexWriterConfig config = new
> IndexWriterConfig(LuceneVersion.CurrentVersion,new
> StandardAnalyzer(LuceneVersion.CurrentVersion));
>
> //these are random tries attempting to solve the problem:
> config.setRAMBufferSizeMB(400);
> TieredMergePolicy mp = (TieredMergePolicy)config.getMergePolicy();
> mp.setUseCompoundFile(true);
> config.setMergePolicy(mp);
> IndexWriter im = new IndexWriter(dir,config);
>
> -- Then just a loop over my doc list calling for indexing:
> im.addDocument(doc, analyzer);
>
>
> Any idea?
> Thanks,
> Luca
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message