Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

System.OutOfMemoryException mystery solved

$
0
0
This isn't actually a question, just thought I would share what I have learned in case anyone else runs into the same issue.Occasionally, SSMS will return a "System.OutOfMemoryException" rather than the result set you were hoping for. Microsoft's documentation explains that this is caused by the SQL Client being a 32-bit process and a result set being larger than 2 GB, thus exceeding the address space of the application. But, what if your query was something like: Select top 1 idintegercolumn from sometable? Surely one integer value can't be greater than 2 GB?!After having the above query fill the memory space of SSMS a few times, it dawned on me that the issue was not the result set, but was most likely intelisense, where behind the scenes SSMS was attempting to gather metadata on quite a few objects in the particular database I was working in (over 100k tables and 12k views, for starters).I tested the same query, but this time using the master database and it worked fine, which backs up my hypothesis. Of course, I'm still open to another explanation, so if anyone has other ideas, I'd love to hear them.Kind regards,Ernest Libertucci

Viewing all articles
Browse latest Browse all 6525

Trending Articles