J'ai une application client C# Windows Webservice écrite en WCF appelant Sql Procédure et ce proc donne une sortie autour de 1,3 million d'enregistrements alors l'application client C# les garde en mémoire et fait toutes les validations une par une :System.OutOfMemoryException
System.Exception: An exception has occurred when recalculating the balances, the transaction will be rolled back.
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()
ce qui pourrait être à l'origine de cette erreur et comment y remédier? J'ai vérifié dans proc, il fonctionne bien
Oui, le proc donne un résultat d'environ 1,3 million d'enregistrements – rmdussa
Vous allez avoir besoin de paginer ces enregistrements! 1,3 million est BEAUCOUP - et bien, comme le dit l'exécution de .Net - il manque de mémoire. –