diff --git a/src/Microsoft.ML.Data/Data/DataViewUtils.cs b/src/Microsoft.ML.Data/Data/DataViewUtils.cs index dd06a4610a..c639186c4e 100644 --- a/src/Microsoft.ML.Data/Data/DataViewUtils.cs +++ b/src/Microsoft.ML.Data/Data/DataViewUtils.cs @@ -942,8 +942,10 @@ public override void Set(BatchColumn batchCol) public override void Unset() { Contracts.Assert(_index <= _count); - if (Values != null) - _pool.Return(Values); + // Remove all the objects from the pool + // to free up references to those objects + while (_pool.Count > 0) + _pool.Get(); Values = null; _count = 0; _index = 0; diff --git a/test/Microsoft.ML.TestFramework/BaseTestClass.cs b/test/Microsoft.ML.TestFramework/BaseTestClass.cs index 1397c8daf1..38c7496a3c 100644 --- a/test/Microsoft.ML.TestFramework/BaseTestClass.cs +++ b/test/Microsoft.ML.TestFramework/BaseTestClass.cs @@ -81,7 +81,7 @@ void IDisposable.Dispose() Cleanup(); Process proc = Process.GetCurrentProcess(); Console.WriteLine($"Finished test: {FullTestName} " + - $"with memory usage {proc.PrivateMemorySize64.ToString("N", CultureInfo.InvariantCulture)}"); + $"with memory usage {proc.WorkingSet64.ToString("N", CultureInfo.InvariantCulture)}"); } protected virtual void Initialize()