Last post Jun 01, 2016 05:18 PM by PatriceSc
May 31, 2016 09:59 PM|praveen251985|LINK
I have 3 linq queries which hit db and get the results. First query is retrieving 15 lakh records and when second query is executing it throws outofmemory exception at 4 lakh records. It has around 10 lakh records. I am getting exception even though when
I get records in chunks using for loop as below:
Can someone suggest on how to avoid this exception?
Jun 01, 2016 12:51 AM|Das.Sandeep|LINK
It looks your data 10K is more, can you reduce your search with smaller 1000. If it works then increase to 5000. Just Curious why you need to fetch this much data?
Jun 01, 2016 04:19 PM|praveen251985|LINK
Thanks for your reply. I need to take the backup of the data in csv format before I purge it. I might come across to process 15 lac records as well. So I made it to bring it in chunks. I am evening assigning the variable to null once I get the data and take
the backup. But still I am getting system.outofmemory exception. Please suggest.
Jun 01, 2016 05:18 PM|PatriceSc|LINK
Do you have to load all in memory using ToList? What happens if you drop "ToList" and just enumerate the results? AFAIK it should then "stream" data using much less memory.