lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r680864 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net/Index: LogByteSizeMergePolicy.cs SegmentInfo.cs SegmentInfos.cs
Date Tue, 29 Jul 2008 22:22:53 GMT
Author: aroush
Date: Tue Jul 29 15:22:53 2008
New Revision: 680864

URL: http://svn.apache.org/viewvc?rev=680864&view=rev
Log:
Fix: LUCENENET-106 Lucene.NET (Revision: 603121) is leaking memory  

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs?rev=680864&r1=680863&r2=680864&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/LogByteSizeMergePolicy.cs Tue Jul 29
15:22:53 2008
@@ -31,11 +31,11 @@
 		public const double DEFAULT_MIN_MERGE_MB = 1.6;
 		
 		/// <summary>Default maximum segment size.  A segment of this size</summary>
-		/// <seealso cref="setMaxMergeMB">
+		/// <seealso cref="SetMaxMergeMB">
 		/// </seealso>
-		public static readonly double DEFAULT_MAX_MERGE_MB = (double) System.Int64.MaxValue;
+		public static readonly double DEFAULT_MAX_MERGE_MB = (double) (System.Int64.MaxValue /
(1024 * 1024));
 		
-		public LogByteSizeMergePolicy():base()
+		public LogByteSizeMergePolicy() : base()
 		{
 			minMergeSize = (long) (DEFAULT_MIN_MERGE_MB * 1024 * 1024);
 			maxMergeSize = (long) (DEFAULT_MAX_MERGE_MB * 1024 * 1024);

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentInfo.cs?rev=680864&r1=680863&r2=680864&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfo.cs Tue Jul 29 15:22:53
2008
@@ -315,6 +315,11 @@
 			si.docStoreOffset = docStoreOffset;
 			si.docStoreSegment = docStoreSegment;
 			si.docStoreIsCompoundFile = docStoreIsCompoundFile;
+			si.docCount = docCount;
+			si.dir = dir;
+			si.files = files;
+			si.name = name;
+			si.sizeInBytes = sizeInBytes;
 			return si;
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/SegmentInfos.cs?rev=680864&r1=680863&r2=680864&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/SegmentInfos.cs Tue Jul 29 15:22:53
2008
@@ -413,7 +413,14 @@
 		
 		public override System.Object Clone()
 		{
-            return new SegmentInfos(this);
+			SegmentInfos si = new SegmentInfos();
+			for (int i = 0; i < base.Count; i++)
+			{
+				si.Add(((SegmentInfo) base[i]).Clone());
+			}
+			si.generation = this.generation;
+			si.lastGeneration = this.lastGeneration;
+			return si;
 		}
 
         private SegmentInfos(SegmentInfos si) : base(si)



Mime
View raw message