System.OutOfMemoryException

Discussion in 'Microsoft ADO .NET' started by michael, Aug 19, 2003.

  1. michael

    michael Guest

    Not quite sure where to post this.

    I have an app that connects to SQL Server 2K via a client
    written in VB .NET 2003(dotnetframework 1.1). It gets its
    connection to the server by creating a connection object
    (New SqlConnection(strConnectionString)).It has been
    running without problems for a couple of months(no
    changes in code).

    Temporally related to the presence of the Blaster worm,
    connections to the server have started to fail, and the
    following exception is
    returned: "System.OutOfMemoryException". Connection to
    the server cannot be restored unless the computer is
    rebooted. I seem to have plenty of available memory on
    the computers and the computers don't seem to be infected
    by the Blaster worm.

    It seems sort of odd that a stable version of software
    should all of the sudden start to fail with this unusual
    exception.


    Any thoughts?

    Michael
     
    michael, Aug 19, 2003
    #1
    1. Advertisements

  2. Check the memory anyway. The .NET garbage collection method may be "causing"
    this. If you find the memory is short, it is likely you are not closing
    certain objects (missing a connection close, et al). We had an app where a
    programmer forgot to close a stream, which ate tons of memory, as it was
    creating new objects all the time, but never destroying them. If there is a
    Close() method, use it. In the same vein, if there is a Dispose() method,
    use it (most likely in the Finally of your Try ... Catch).

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    Author: ADO.NET and XML: ASP.NET on the Edge

    ****************************************************************************
    ****
    Think Outside the Box!
    ****************************************************************************
    ****
    "michael" <> wrote in message
    news:0c1d01c36649$b2607ee0$...
    > Not quite sure where to post this.
    >
    > I have an app that connects to SQL Server 2K via a client
    > written in VB .NET 2003(dotnetframework 1.1). It gets its
    > connection to the server by creating a connection object
    > (New SqlConnection(strConnectionString)).It has been
    > running without problems for a couple of months(no
    > changes in code).
    >
    > Temporally related to the presence of the Blaster worm,
    > connections to the server have started to fail, and the
    > following exception is
    > returned: "System.OutOfMemoryException". Connection to
    > the server cannot be restored unless the computer is
    > rebooted. I seem to have plenty of available memory on
    > the computers and the computers don't seem to be infected
    > by the Blaster worm.
    >
    > It seems sort of odd that a stable version of software
    > should all of the sudden start to fail with this unusual
    > exception.
    >
    >
    > Any thoughts?
    >
    > Michael
     
    Cowboy \(Gregory A. Beamer\), Aug 19, 2003
    #2
    1. Advertisements

  3. You will probably have to profile the system and log the counters. This
    could take quite a bit of space, but can alert you what was happening when
    the exception was thrown. This won't solve the problem, but will give you
    the right direction to solve it.

    One possibility is the wrong exception is being thrown. While not as common,
    MS has been known to throw the exception they expect from a component. A
    great example is the ADO error from Access (same error no matter what
    happened). If this is the case, it will make it more difficult to find the
    real culprit, which is why I suggest profiling first.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    Author: ADO.NET and XML: ASP.NET on the Edge

    ****************************************************************************
    ****
    Think Outside the Box!
    ****************************************************************************
    ****
    "michael" <> wrote in message
    news:0e2801c36664$c6aa2cf0$...
    > I looked at available memory in the Task Manager and it
    > seems that there is plenty. In addition, I am only
    > opening a single connection, no streams or anything else
    > large (in the memory sense). Also, other programs seem to
    > work well. I'm really at a loss.
    >
    > Michael
    >
    >
    >
    > >-----Original Message-----
    > >Check the memory anyway. The .NET garbage collection

    > method may be "causing"
    > >this. If you find the memory is short, it is likely you

    > are not closing
    > >certain objects (missing a connection close, et al). We

    > had an app where a
    > >programmer forgot to close a stream, which ate tons of

    > memory, as it was
    > >creating new objects all the time, but never destroying

    > them. If there is a
    > >Close() method, use it. In the same vein, if there is a

    > Dispose() method,
    > >use it (most likely in the Finally of your Try ...

    > Catch).
    > >
    > >--
    > >Gregory A. Beamer
    > >MVP; MCP: +I, SE, SD, DBA
    > >Author: ADO.NET and XML: ASP.NET on the Edge
    > >
    > >*********************************************************

    > *******************
    > >****
    > >Think Outside the Box!
    > >*********************************************************

    > *******************
    > >****
    > >"michael" <> wrote in message
    > >news:0c1d01c36649$b2607ee0$...
    > >> Not quite sure where to post this.
    > >>
    > >> I have an app that connects to SQL Server 2K via a

    > client
    > >> written in VB .NET 2003(dotnetframework 1.1). It gets

    > its
    > >> connection to the server by creating a connection

    > object
    > >> (New SqlConnection(strConnectionString)).It has been
    > >> running without problems for a couple of months(no
    > >> changes in code).
    > >>
    > >> Temporally related to the presence of the Blaster worm,
    > >> connections to the server have started to fail, and the
    > >> following exception is
    > >> returned: "System.OutOfMemoryException". Connection to
    > >> the server cannot be restored unless the computer is
    > >> rebooted. I seem to have plenty of available memory on
    > >> the computers and the computers don't seem to be

    > infected
    > >> by the Blaster worm.
    > >>
    > >> It seems sort of odd that a stable version of software
    > >> should all of the sudden start to fail with this

    > unusual
    > >> exception.
    > >>
    > >>
    > >> Any thoughts?
    > >>
    > >> Michael

    > >
    > >
    > >.
    > >
     
    Cowboy \(Gregory A. Beamer\), Aug 19, 2003
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasco Veiga [MS]
    Replies:
    0
    Views:
    1,689
    Vasco Veiga [MS]
    Jul 27, 2003
  2. Paschal

    System.OutOfMemoryException

    Paschal, Nov 14, 2003, in forum: Microsoft ADO .NET
    Replies:
    3
    Views:
    424
    Theo Verweij
    Aug 23, 2006
  3. Scorpio3073
    Replies:
    0
    Views:
    249
    Scorpio3073
    Dec 28, 2004
  4. Guest

    OutOfMemoryException on DataTables

    Guest, Mar 5, 2006, in forum: Microsoft ADO .NET
    Replies:
    13
    Views:
    489
    Willy Denoyette [MVP]
    Mar 7, 2006
  5. C#Coder

    System.OutOfMemoryException in DataAdapter

    C#Coder, Oct 6, 2009, in forum: Microsoft ADO .NET
    Replies:
    4
    Views:
    4,965
    misfit815
    Oct 28, 2009
Loading...

Share This Page