How to force outofmemory exception throw

G

Guest

In the production environment, it always occurs and the worker process
did not recycle automatically. Therefore, it make the system service break
to client.

In development environment, we write a program to loop sth and force
outofmemory throw. however, when the w3wp exceed physical mem,
the process recycle automatically, no outofmemory throw.

Any idea?
thank you
 
M

Mike Labosh

I personally have never seen this happen.

However, I would imagine that if the system is SO maxed out as to throw an
OutOfMemory exception, I am pretty certain that either throwing a new
exception, or wrapping a new exception around it would only make matters
worse.

Suppose you did something like this:

<vb>
Try
' all your stuff
Catch exc As OutOfMemoryException
GC.Collect()
Finally
' Only you know what.
End Try
</vb>

<C# [I think]>
try {
// all your stuff
} catch OutOfMemoryException {
GC.Collect()
} finally {
// only you know what.
}
</C#>
--
Peace & happy computing,

Mike Labosh, MCSD
"Working here is like living inside a Salvador Dali painting." -- Me. Yeah,
ME! [Oh fer cryin out loud]
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top