0

I have a piece of code that itrates over a 2 GB PDF, extracts information and using this piece of code inserts into a DB.

for( int i = 0 ; i < the length of the file ; i++)
{
  read something 

  Task t = new Task(() => Update(newmerch), TaskCreationOptions.PreferFairness);
                            t.Start();

}

When I run this code in release mode, I am getting an out of memory exception, while in debug build it works fine.

Any thoughts would be greatly appreciated.

2
  • 2
    Are you really trying to create 2 000 000 000 Tasks?
    – svick
    Jun 4, 2014 at 16:52
  • Any thoughts would be greatly appreciated. I think that if you have a 2 GB PDF, you should probably rethink your data storage. You should probably store data in a format that's easier to work with.
    – Geeky Guy
    Jun 4, 2014 at 16:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.