Lucene.Net.Index.IndexWriter.RamSizeInBytes C# (CSharp) Method

RamSizeInBytes() public method

Expert: Return the total size of all index files currently cached in memory. Useful for size management with flushRamDocs()
public RamSizeInBytes ( ) : long
return long
		public long RamSizeInBytes()
		{
			EnsureOpen();
			return docWriter.GetRAMUsed();
		}
		

Usage Example

Beispiel #1
0
 public override void Run()
 {
     try
     {
         long ramSize = 0;
         while (PendingDocs.DecrementAndGet() > -1)
         {
             Document doc = Docs.NextDoc();
             Writer.AddDocument(doc);
             long newRamSize = Writer.RamSizeInBytes();
             if (newRamSize != ramSize)
             {
                 ramSize = newRamSize;
             }
             if (DoRandomCommit)
             {
                 if (Rarely())
                 {
                     Writer.Commit();
                 }
             }
         }
         Writer.Commit();
     }
     catch (Exception ex)
     {
         Console.WriteLine("FAILED exc:");
         Console.WriteLine(ex.StackTrace);
         throw new Exception(ex.Message, ex);
     }
 }
All Usage Examples Of Lucene.Net.Index.IndexWriter::RamSizeInBytes
IndexWriter