473,783 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to force outofmemory exception throw

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
Nov 19 '05 #1
1 1928
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 OutOfMemoryExce ption
GC.Collect()
Finally
' Only you know what.
End Try
</vb>

<C# [I think]>
try {
// all your stuff
} catch OutOfMemoryExce ption {
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]
"Ricky Chan" <Ri*******@disc ussions.microso ft.com> wrote in message
news:29******** *************** ***********@mic rosoft.com...
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5458
by: Mike Schilling | last post by:
Instances of SystemOutOfMemoryException do not contain a stack trace. Easy test to verify this: class OOM { public static void Main() { try { Object arr = new Object; } catch (Exception ex) { dumpEx(ex);
2
18599
by: David Hunt | last post by:
I'm developing a Windows Service and just added a standard try... catch exception handler to its OnStart() routine. I would like to know how to force the service to abort its startup when an exception is encountered. In my current version, the exception handler logs the exception, but then the service continues to run. I'd like it to NOT run after logging the exception. Thanks!
1
2237
by: BuddyWork | last post by:
Hello, I want to know how I can force a GC to run outside the application. For example. App1 which is where I want the GC to be collected. I don't want to run GC.Collect within this application. I want to create App2 which will call GC.Collect within App1 some how. The main reason to force the GC collection is that GEN2 collection is growing very fast and I adventgually get
2
1765
by: Ricky Chan | last post by:
Windows Server 2003 with 2G Ram ,IIS6 -> I have enabled /3gb switch in boot.ini ! -> Machine.config set to 80% memory Limit However, It still throw outofmemory exception when loading large amount of data.
1
2812
by: yancheng.cheok | last post by:
Hi all, According to "How can I handle a constructor that fails?" in http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.2, whenever there is a constructor fail, we will throw exception. However, how can we make the interface easy to use correctly and hard to use incorrectly? Client may forget/ ignore from having a try...catch block whenever they call the constructor. Is there any way we can prevent this from happen?
7
24529
by: Arnd Iffland | last post by:
Hi, i want to use a StringBuilder to create a large string. After instatiation, the MaxCapacity is 2.147.483.647, what is large enough for my purpose. During my procedure i get a SystemOutOfMEmoryException at System.String.GetStringForBuilder
2
7880
by: Peter S. | last post by:
I am pulling some data from a source via ODBC and placing the information in a DataSet. The first pull is very large but once that is complete I plan to do nightly pulls to get any new data that gets put in the (remote) table. I can't seem to get past that initial (big) pull of data, as I get OutOfMemory exceptions. I took a look back at when this occurs and it seems to happen upon stuffing the DataSet with either the 2097153 record or...
8
13361
by: Mantorok | last post by:
Hi all I'm populating a DataTable with around 1,500,000 rows, the table contains 4 columns, 3 string columns and a decimal column. However, I keep getting OutOfMemory exceptions when my app starts to reach around 700MB memory (this is a console app by the way). So, question is, why does the DT eat so much memory and how can I avoid these OutOfMemory exceptions? I "need" all of these rows available because
0
1128
by: =?Utf-8?B?RGFya3Jpc2Vy?= | last post by:
I have managed code in C# calling unmanaged code from a DLL written in C++. Every time an Exception is thrown by unmanaged code, this exception is handled by C# directly. How to force to handle the exception by the DLL itself, instead of C# ? example attached below. //C# code public static extern int A();
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.