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

  • Hi,

    I am geting this error when I try to run a quer through SSMS.

    Table got 23000 records and SQL srever max memoy assigned 3024.

    Thank you in Advance,

    Krishna

  • Are you running SSMS locally or on the server.

    Which ever it is that system doesnt have enough free memory to display the result set.

  • Thank you for your reply. Same issue even if I try from loacl or RDP.

    Evene I have ran this DBCC DROPCLEANBUFFERS, still am geing same issue ....

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

    Thank you.

  • The system is out of memory then, I suggest limiting the result set or adding more RAM to the machines

  • krishnaprasad14 (7/10/2012)


    Hi,

    I am geting this error when I try to run a quer through SSMS.

    Table got 23000 records and SQL srever max memoy assigned 3024.

    Thank you in Advance,

    Krishna

    Run the results of the query into a file. The grid in SSMS is a resource hog.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Hi Thank you for your replay. I was done this. I can execute if I change query results to text o file but geting an error when I choose grid. BUt user's want to see in grid formate

    Thank you

  • krishnaprasad14 (7/11/2012)


    Hi Thank you for your replay. I was done this. I can execute if I change query results to text o file but geting an error when I choose grid. BUt user's want to see in grid formate

    Thank you

    23,000 rows doesn't seem much for this message to appear - on the other hand, nobody is going to scan this many rows by eye. Can't you restrict the rowcount to something more reasonable?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Really can't modify anything.

    [My self I think 23,000 row count is not big for GB Ram server....]

    Thank you.

  • krishnaprasad14 (7/11/2012)


    Really can't modify anything.

    [My self I think 23,000 row count is not big for GB Ram server....]

    Thank you.

    It's the client limit, not the server, as Anthony pointed out in an earlier post.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • I'm getting this same error on a 64-bit workstation w/ 24GB of ram, 15GB that Win7 lists as "available". This is unlikely to be a windows limit and more likely a leak or bug within SSMS.

    I was just doing a TOP 100 query against a few small tables on different servers. They were all behaving the same way. Another instances of SSMS that I had open was behaving fine.

    In my case, it's SQL Server 2012 SP1 (11.0.3128.0)

    aka: the most problematic release of SSMS to date!

  • My best guess is that the garbage cleanup in SSMS is flawed.

    I get this error repeatedly, usually under the following circumstances:

    1. SSMS has been open for a long time (days...I don't usually shut down my PC at work)

    2. Have at least 4-5 minimum query windows open

    3. SSMS is using around 700MB of ram on my PC

    At some point, even a request for just a table with a few rows of data will show this error.

    Even if I close all query windows and open a new fresh window, the error still persists.

    We're using SQL Server 2012 on the server, and SSMS for SQL Server 12 on local client machines.

    All developers in our group have experienced this error at one time or another.

    Advice to Microsoft: Once a query window is closed, clean-up memory to allow for new work to commence.

  • Ditto. I do leave SSMS running for a few days, and I get it moaning at me. I've got 11GB of RAM free on my workstation and still it complains.

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

    The GUI is also slower than 2008R2 when doing restores - yes I can code but sometimes its just nice to be lazy and use the GUI.

    Two steps forward one step back...

  • The same is for SSMS 2012..it loses the plot also. Simply save your work and restart it and the problem is solved.

  • From Microsoft: SSMS is a 32-bit process. Therefore, it is limited to 2 GB of memory.

Viewing 14 posts - 1 through 13 (of 13 total)

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