Memory Leak Question - ADO Recordsets

  • Since 1/2004 we have been running an ASP/SQL Server Intranet application. The app was written in-house and it works fine. Since its deployment we have seen the memory on the Windows 2000 Server be used, but it does not get released.  We do weekly server maintenance with includes a reboot, so this frees the memory and we start all over again.

     

    I have posted a question about this problem before and the answers were: “SQL Server will take what memory it needs, and give it back to the OS after a while.”

     

    We don’t see the memory being freed at all.  So this leads me to believe we have a true “Memory Leak.”  After poking around in the ASP I found that the Lead Developer who created the Data Access Class does not destroy the Connection or the Recordset Objects.  Since this is Classic ASP we are using ADO with Stored Procedures, and only Stored Procedures.

     

    Can this simply be a matter of (2) lines of code to Destroy the Recordset Object:

     

    oRS.Close          ‘ Close the Recordset

    oRS = Nothing   ‘ Clear the Recordset Object

     

    And (2) lines of code to Destroy the Connection Object:

     

    oConn.Close          ‘ Close the Connection

    oConn = Nothing   ‘ Clear the Connection Object

     

    Also, I noticed we are using Object ADOR.Recordset and not ADODB.Recordset.

     

    Thanks in advance to all who read and reply to this posting.

     

    Steve DiDomenico

    Nashua, NH

  • *Closing the connections would be a great start. (releases remaining locks etc)

    *Sql server's goal is to occupy memory till 4-10mb free memory is left over. (in dynamic memory allocation mode)

    Motto: not occupied=not needed=wasted. So till another application needs the memory, sql server won't release it.

    see "memory, dynamically managing" in the books online.

    At work it tries to keep 100mb free (reserved for windows 2003 OS)

    *How to monitor sql server memory usage:

    see "memory, monitoring usage" in the books online

  • Thanks Jo.

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

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