SQL Server Performance

System.OutOfMemoryException

Discussion in 'Non-Transact SQL Developer Performance Tuning' started by PAMUR, Aug 24, 2005.

  1. PAMUR New Member

    Hi,

    My query returns only one row. estimated row size is 5478. All other queries run fine but this particular query is throwing System.OutOfMemoryException. When does SQL server throw this error for a particular query only?

    This is the query which is throwing error System.OutOf Memory exception

    SELECT * FROM MemberDetail MD INNER JOIN Users ON Users.g_User_Id=MD.g_User_Id WHERE Users.u_logon_name='anna'

    Environment is .Net and SQL Server

    http://weblogs.asp.net/pleloup/archive/2004/04/01/105492.aspx

    Please help!
  2. ranjitjain New Member

    hi,
    I think its nothing to do with the query.
    The error is because of .net framework.
    I think you need to handle the System.OutOfMemoryException class in .net properly.
  3. dineshasanka Moderator

  4. benwilson New Member

    i get the out of memory exception when i am building complex views in the SQL Server 2005 June CTP...if ranjitjain is right, looks like microsoft needs to handle the error properly too!

    'I reject your reality and substitute my own' - Adam Savage
  5. satya Moderator

    In that case:

    - The CLR does not release unmanaged resources which your program objects have used. Your code must explicitly release unmanaged resources by calling the Dispose method on objects which have used unmanaged resources.

    - Under some circumstances, the CLR will not remove large unreferenced objects from memory without help from your code.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  6. PAMUR New Member

    Thanks to All

    Its been very helpfull.


    Thanks once again.
  7. bubberz New Member

    quote:Originally posted by PAMUR

    Thanks to All

    Its been very helpfull.


    Thanks once again.

    **********

    Pamur....what did you do to fix the issue? I'm running into the same error.

    Thanks!
  8. satya Moderator

  9. bubberz New Member

    I can run the query in Enterprise Manager or Query Analyzer just fine.

  10. satya Moderator

    Check the SQL error log and for any dump file when this strikes again.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  11. bubberz New Member

    Well.....I fixed the issue by telling my list object to break to a new page on change of grouping. I am able to now get a +1000 page report. I don't think the customer can or would want to print / export it, but at least for my issue, the data getting displayed is resolved.

    Thanks!

Share This Page