How am I running out of memory?

  • My machine seems to throw this error often
    An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.
    What can I do to determine the memory pressure? This morning this simple 2 row query caused it. Is the server out of memory, or is my machine out of memory - how can I diagnose what is going on here?
    TIA,
    SQLOzzie
     SELECT DB_NAME() AS Database_Name
     , sc.name AS Schema_Name
     , o.name AS Table_Name
     , i.name AS Index_Name
     , i.type_desc AS Index_Type
     FROM sys.indexes i
     INNER JOIN sys.objects o ON i.object_id = o.object_id
     INNER JOIN sys.schemas sc ON o.schema_id = sc.schema_id
     WHERE i.name = 'IX_BDABase_DataSetRunID_SiteID_Variable_Result#VisitNumber'
     AND o.type = 'U'
     ORDER BY o.name, i.type

  • That's an SSMS error, not SQL Server. SSMS is a 32bit application, and thus is quite limited on how much memory it can address (can't recall if it's 512MB or 2GB that it "runs out" at). If you use too much, it'll return this result. It might not even be that particular query that caused SSMS to use a lot of your RAM, but something did. Closing and reopening SSMS (or opening a new one) will resolve the issue.

    If you need to run a query that will return a HUGE result set, don't do it in SSMS.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • The key indicator that it's not an error from SQL Server is that it's a .net exception. SQL Server is not written in .net, and won't throw .net exceptions

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • TY.

Viewing 4 posts - 1 through 3 (of 3 total)

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