System.OutOfMemoryException

M

michael

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
 
C

Cowboy \(Gregory A. Beamer\)

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!
****************************************************************************
****
 
C

Cowboy \(Gregory A. Beamer\)

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!
****************************************************************************
****
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top