title: System.OutOfMemoryException
body: <p>I have C# Client application calling Windows webservice written in WCF calling Sql Procedure and this proc give output around 1.3 million records then the C# client application keep them in memory and  does all validations one by one
  I am getting error:</p>
  
  <blockquote>
    <p>System.Exception: An exception has
    occurred when recalculating the
    balances, the transaction will be
    rolled back.</p>
  </blockquote>
  
  <hr>
  
  <pre><code>System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
     at System.Collections.Generic.List`1.set_Capacity(Int32 value)
     at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
     at PitToPort.DataLayer.StockpileData.StockpileProfile.CreateStockpileProfileQualityFromAllPartialMovements()
     at PitToPort.DataLayer.StockpileRecalc.Recalc.CreateSP_FOFO_FOLO_NegTransaction(Int32 modelID, StockpileProfile currentStockpileProfile, TransactionsRow drTransactions)
     at PitToPort.DataLayer.StockpileRecalc.Recalc.CreateBalanceFOLO_FOFO_TWAA(TransactionsRow[] drTransactionsRows, Int32 modelID, StockpileProfileList stockpileProfileList)
     at PitToPort.DataLayer.StockpileRecalc.Recalc.CreateBalances()
     at QMastor.PitToPort.StockpileRecalculationBL.RecalcService.CreateBalances()
  </code></pre>
  
  <p>what might be to cause this error and how to rectify it? I have checked in proc,it is running fine</p>