System.OutOfMemoryException

  • An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.

    I was running a query which pulls 10million records, after running for 1 hour it gave me this error. how shud i troubleshoot this, what is the cause?

  • you could maybe limit the query

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • what do u mean by limit the query. do you want the query to run in batches for select statement.

  • Where are you gettings those records from?

    What do you intend to do with them?

    I'm guessing here that this is some sort of dataload since showing 10M records to the users is quite useless (from my humble experience).

  • Ninja's_RGR'us (2/15/2009)


    since showing 10M records to the users is quite useless (from my humble experience).

    my thoughts exactly

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Hey Darth. stop reading my freaking mind!!!

    or is it the other way around :D.

  • Ninja's_RGR'us (2/15/2009)


    Hey Darth. stop reading my freaking mind!!!

    or is it the other way around :D.

    i find your lack of faith most disturbing ....... LOL

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • You'll find that you can't argue with yourself :P.

  • What are you doing with the 10 million records? Aggregating? Feeding into another application? The intended use of the records may provide some assistance as to how to improve performance.

    Also, how is the table indexed? Have you run your query through DTA to see what SQL recommends with regard to indices associated with the query?

    Also, how much RAM does the system running the query have? How many procs/cores? It could be that you need to turn on AWE, adjust your sql memory to 3 gig and increase your SQL Server pool size using the -g switch.

    If you actually do need the 10 million rows, there may be ways to optimize the query and/or system to support that.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply