There are knowledgebase articles on this. The root cause can be found by doing an internet search for '.NET datatable out of memory' - it is how .NET handles large blocks of data in datatables (which is effectively what a collection is), the solution is to reorchestrate your solution to handle smaller bits of the data at a time and also the knowledgebase article has advice about removing rows and invoking the garbage collector.