PC Review


Reply
Thread Tools Rate Thread

System.OutOfMemoryException

 
 
michael
Guest
Posts: n/a
 
      19th Aug 2003
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
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      19th Aug 2003
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" <(E-Mail Removed)> wrote in message
news:0c1d01c36649$b2607ee0$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      19th Aug 2003
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" <(E-Mail Removed)> wrote in message
news:0e2801c36664$c6aa2cf0$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> >news:0c1d01c36649$b2607ee0$(E-Mail Removed)...
> >> 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

> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:21 PM.