C# Outofmemory Exception When Returning A Small Datatable
I have a SQLite database that has a single table with 18 million rows and 24 columns. I have written a SQL query function in C#, which I expose to Excel with ExcelDNA. This is the
Solution 1:
Your code does not have anything which can cause OutOfMemoryException. So possibility is huge datatable and memory not getting recovered immediately. One possibility is - As you are reading excel.. it may have blank rows at the end, which may potentially can increase dt size.....
As datatable is managed object calling dispose will not really help.. But at lease you can clear dt everytime once it use is over..
Post a Comment for "C# Outofmemory Exception When Returning A Small Datatable"