I can't figure out why once or twice per week, my C# server application
throws OutOfMemoryExce ptions. There is plenty of memory in the machine. As
far as I can tell, when the exception is thrown, only 400 megs of 1gig total
is in use.
The exception is thrown while trying to update List<>. Here's a bit of the
stack trace:
===
System.OutOfMem oryException: Exception of type 'System.OutOfMe moryException'
was thrown.
at System.Collecti ons.Generic.Lis t`1.set_Capacit y(Int32 value)
at System.Collecti ons.Generic.Lis t`1.EnsureCapac ity(Int32 min)
at System.Collecti ons.Generic.Lis t`1.Add(T item)
at Mosaic.Core.Sta tUtils.ExtractR ORs(MiniPerfIte m[] perfItems, Int32
startIdx, Int32 endIdx, Boolean useNAOnNonPosBa l) in
C:\Development\ Mosaic\Mosaic-AM\Mosaic.Core. Shared\Code\Uti lities\Statisti cal\StatUtils.c s:line
38
===
I have a lot of small objects in memory at the time of the exception but I'm
nowhere close to exhausting available RAM. Any ideas? 19 2052
Lamont Sanford <ya********@san ford.sonwrote:
I can't figure out why once or twice per week, my C# server application
throws OutOfMemoryExce ptions. There is plenty of memory in the machine. As
far as I can tell, when the exception is thrown, only 400 megs of 1gig total
is in use.
The exception is thrown while trying to update List<>. Here's a bit of the
stack trace:
===
System.OutOfMem oryException: Exception of type 'System.OutOfMe moryException'
was thrown.
at System.Collecti ons.Generic.Lis t`1.set_Capacit y(Int32 value)
at System.Collecti ons.Generic.Lis t`1.EnsureCapac ity(Int32 min)
at System.Collecti ons.Generic.Lis t`1.Add(T item)
at Mosaic.Core.Sta tUtils.ExtractR ORs(MiniPerfIte m[] perfItems, Int32
startIdx, Int32 endIdx, Boolean useNAOnNonPosBa l) in
C:\Development\ Mosaic\Mosaic-AM\Mosaic.Core. Shared\Code\Uti lities\Statisti cal\StatUtils.c s:line
38
===
I have a lot of small objects in memory at the time of the exception but I'm
nowhere close to exhausting available RAM. Any ideas?
Do you have any idea how big the list is at the point of failure?
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Do you have any idea how big the list is at the point of failure?
>
At max it could get up to the tens of thousands, but certainly never over
100k...
OutOfMemoryExce ption really means "out of resources". Are you opening
files and not disposing them or something?
http://mrpmorris.blogspot.com/2006/1...maybe-not.html
Interesting. I'll check out the article.
No, I don't make use of files to any major extent, but I do use a lot of
database connections. Maybe I'm not closing them properly?
Most likely - improperly closed / disposed connection objects means you run
out of Connection Pool connections, which can cause exceptions similar to
what you're seeing - especially if combined with other code.
1) use the same connection string througout your app.
2) open a connection just before you need to do database call.
3) close the connection immediately after - this returns it to the pool
4) be very careful with DataReaders as they hold open a connection.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"Lamont Sanford" wrote:
OutOfMemoryExce ption really means "out of resources". Are you opening
files and not disposing them or something? http://mrpmorris.blogspot.com/2006/1...maybe-not.html
Interesting. I'll check out the article.
No, I don't make use of files to any major extent, but I do use a lot of
database connections. Maybe I'm not closing them properly?
Lamont Sanford <ya********@san ford.sonwrote:
Do you have any idea how big the list is at the point of failure?
At max it could get up to the tens of thousands, but certainly never over
100k...
That sounds unlikely to be the issue then.
Can I suggest that you use perfmon to look at both the heap and the
handle count of your process?
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Lamont Sanford pisze:
I can't figure out why once or twice per week, my C# server application
throws OutOfMemoryExce ptions. There is plenty of memory in the machine. As
far as I can tell, when the exception is thrown, only 400 megs of 1gig total
is in use.
The exception is thrown while trying to update List<>. Here's a bit of the
stack trace:
===
System.OutOfMem oryException: Exception of type 'System.OutOfMe moryException'
was thrown.
at System.Collecti ons.Generic.Lis t`1.set_Capacit y(Int32 value)
at System.Collecti ons.Generic.Lis t`1.EnsureCapac ity(Int32 min)
at System.Collecti ons.Generic.Lis t`1.Add(T item)
at Mosaic.Core.Sta tUtils.ExtractR ORs(MiniPerfIte m[] perfItems, Int32
startIdx, Int32 endIdx, Boolean useNAOnNonPosBa l) in
C:\Development\ Mosaic\Mosaic-AM\Mosaic.Core. Shared\Code\Uti lities\Statisti cal\StatUtils.c s:line
38
===
I have a lot of small objects in memory at the time of the exception but I'm
nowhere close to exhausting available RAM. Any ideas?
Maybe due to extensively allocating and freeing memory, your memory is
too much fragmentized ?
Regards
>
That sounds unlikely to be the issue then.
Can I suggest that you use perfmon to look at both the heap and the
handle count of your process?
Sure, I'll check it out. I've never used permon before. What signs/symptoms
should I be looking for?
Maybe due to extensively allocating and freeing memory, your memory is
too much fragmentized ?
How would I go about defragmenting it? Should I manually run a garbage
collection? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Peter Aberline |
last post by:
Hi all,
We have written a C # .NET application and we're
encountering memory problems in the form of
System.OutOfMemoryException.
Our application creates many thousands of objects in a
temporary in memory store, which uses a lot of runtime
memory. Not an ideal situation, but an acceptable short
term solution given our project constraints.
|
by: Per Bergland |
last post by:
After many woes, I finally managed to get a stack dump of my System
Service (written in C#) that insists on crashing when launched at system
boot time (see below on how to get this dump - I couldn't find any info
on how to do this).
Here's the stack trace from cordbg:
Unhandled exception generated: (0x04719c94)
<System.Runtime.Remoting.RemotingException>
_className=<null>
_exceptionMethod=<null>
|
by: Fernando Casero |
last post by:
Hi, I'm programming on Visual C# Express Beta 2 and I have the following
code:
class MyClass
{
int a = new int
int b = new int
public int SomeMethod()
}
|
by: Ripul Handa |
last post by:
Hi
We are running IIS 5.0 cluster with cisco local director.
We are running a website on 2 webservers and I have been
observing that from past few days we have are getting
this error message of and on
Error Messag
Remote IP:66.122.242.6
Host:216.211.212.2
|
by: SMG - Idealake |
last post by:
Hi all,
I am getting following error on my error, what could be the reason?
Exception of type System.OutOfMemoryException was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Exception of type
System.OutOfMemoryException was thrown.
| |
by: Dave |
last post by:
We just started getting this error message in our application today (stack
trace below). From the OutOfMemoryException, I'm guessing it could be a
memory leak. I'm making sure I'm closing all my connections in the finally
block but I'm not sure what I should be doing.
As far as the "Unable to serialize the session state" error, this app has
been running for days and this is the first I've seen this one as well.
Any thoughts would be...
|
by: Ashkan Daie |
last post by:
Hi All,
When trying to install a performance counter via InstallUtil I get the
following exception:
Creating performance counter category Enterprise Library Caching.
An exception occurred during the Install phase.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException'
was
|
by: =?Utf-8?B?UGlnZ3k=?= |
last post by:
Hi to all,
I am getting this System.OutOfMemoryException calling the
Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(<stream>,<Obj>) method.
The type of <streamis IO.MemoryStream
=====Exception:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException'
was
thrown.
|
by: Lamont Sanford |
last post by:
I can't figure out why once or twice per week, my C# server application
throws OutOfMemoryExceptions. There is plenty of memory in the machine. As
far as I can tell, when the exception is thrown, only 400 megs of 1gig total
is in use.
The exception is thrown while trying to update List<>. Here's a bit of the
stack trace:
===
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException'
|
by: netwapps |
last post by:
I have:
Application Type: Web application with VB.net 1.1
WebServer: IIS6
Machine Server: Windows 2003
The User opens 4-5 browsers connecting to the application and clicks on the Autorefresh button. This button puts javascript code in the page that will cause the page to Automatically refresh every x amount of minutes. after about 4-5 times of refreshing the browser will come back with this error:
In 2 pages:
[HttpException...
|
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...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |