Lucene.Net.IndexTest.Main C# (CSharp) Method

Main() private method

private Main ( System args ) : void
args System
return void
		public static void  Main(System.String[] args)
		{
			try
			{
				System.DateTime start = System.DateTime.Now;
				// FIXME: OG: what's with this hard-coded dirs??
				IndexWriter writer = new IndexWriter("F:\\test", new SimpleAnalyzer(), true);
				
				writer.mergeFactor = 20;
				
				// FIXME: OG: what's with this hard-coded dirs??
				IndexDocs(writer, new System.IO.FileInfo("F:\\recipes"));
				
				writer.Optimize();
				writer.Close();
				
				System.DateTime end = System.DateTime.Now;
				
				System.Console.Out.Write(end.Ticks - start.Ticks);
				System.Console.Out.WriteLine(" total milliseconds");
				
				System.Diagnostics.Process runtime = System.Diagnostics.Process.GetCurrentProcess();
				
                // System.Console.Out.Write(runtime.freeMemory());          // {{Aroush}} -- need to report how much free memory we have
				System.Console.Out.WriteLine(" free memory before gc");
				System.Console.Out.Write(System.GC.GetTotalMemory(true));
				System.Console.Out.WriteLine(" total memory before gc");
				
				System.GC.Collect();
				
                // System.Console.Out.Write(runtime.freeMemory());          // {{Aroush}} -- need to report how much free memory we have
                System.Console.Out.WriteLine(" free memory after gc");
                System.Console.Out.Write(System.GC.GetTotalMemory(true));
                System.Console.Out.WriteLine(" total memory after gc");
			}
			catch (System.Exception e)
			{
				System.Console.Out.WriteLine(" caught a " + e.GetType() + "\n with message: " + e.Message);
			}
		}