473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Memory increase and hang

Hi,

I have an C# application and after about 12 hours it hangs with a .NET
Error System.OutOfMemoryException. This error is received after
GC.GetTotalMemory: 100038436 and in task manager the used memory is
about 130,000k.
I used GC.Collect but did not help. Please help.

Thanks in advance
Dan

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
5 5482
"Dan Pavel" <my**************@yahoo.com> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I have an C# application and after about 12 hours it hangs with a .NET
Error System.OutOfMemoryException. This error is received after
GC.GetTotalMemory: 100038436 and in task manager the used memory is
about 130,000k.
I used GC.Collect but did not help. Please help.


Almost certainly you are not disposing resources correctly - you ABSOLUTELY
CANNOT rely on the GC to do this for you!!!!
Nov 17 '05 #2
You must make sure you understand the GC and how it works... I strongly advise
you to have a loot at a few articles:

http://msdn.microsoft.com/library/de...etgcbasics.asp
http://msdn.microsoft.com/library/de...00/GCI/TOC.ASP
http://msdn.microsoft.com/library/de...0/GCI2/TOC.ASP
http://blogs.msdn.com/ricom/archive/...23/421205.aspx

Without looking at the code i would say that you are not disposing of resources
or you are caching too much data without releasing it.... but it could be
so much more... A very common mistake is that many programmers work against
the GC without knowing it... read those articles and reformulate you question
as well as posting some code you suspect is holding data or allocating unecessary
data.
And about calling GC.Collect, please read http://blogs.msdn.com/ricom/archive/...29/271829.aspx.

Erick Sgarbi
Hi,

I have an C# application and after about 12 hours it hangs with a .NET
Error System.OutOfMemoryException. This error is received after
GC.GetTotalMemory: 100038436 and in task manager the used memory is
about 130,000k.
I used GC.Collect but did not help. Please help.
Thanks in advance
Dan
*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #3
That means you are consuming more memory than there is available. The reason
can be a bug in your code, or simply a design error.
A bug can be not disposing unmanaged resources, but there might be other
reasons.
A design error can be allocating too large data structures (arrays,
ArrayLists ...).

Anyway, what you should do is measure the memory consumption at run-time
using permon.exe, pay special attention to GC memory and non-GC memory, that
are the CLR memory counters and the process private byte counters.

Willy.

"Dan Pavel" <my**************@yahoo.com> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have an C# application and after about 12 hours it hangs with a .NET
Error System.OutOfMemoryException. This error is received after
GC.GetTotalMemory: 100038436 and in task manager the used memory is
about 130,000k.
I used GC.Collect but did not help. Please help.

Thanks in advance
Dan

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #4
Hi,

Probably you have one of two situations:
1- You are keeping too many objects in memory without dereferencing them
hence they are never collected
2- you use any external resource that you are nt disposing.

what your app does?
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dan Pavel" <my**************@yahoo.com> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have an C# application and after about 12 hours it hangs with a .NET
Error System.OutOfMemoryException. This error is received after
GC.GetTotalMemory: 100038436 and in task manager the used memory is
about 130,000k.
I used GC.Collect but did not help. Please help.

Thanks in advance
Dan

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #5
My app is monitoring some workstations and start/stop some workflows on
that machines. I am using SNMP for this.

An interesting thing: my app runs hidden. I have a notification Icon in
task bar. when I click on the icon the form opens. after I close the
form (app keeps running) the used memory reported for my app's process
in Task manages goes to about 1,000 k. Why this way the memory goes down
and else goes up ?

Thanks,
Dan

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #6

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

Similar topics

9
by: Birgit Rahm | last post by:
Hello newsgroup, I am a beginner, so I am asking maybe immoderate questions. I want to delete a variable, after filling it with complex objects. How should I do it? e.g. AAA = AAA = Can I...
0
by: Erik Miller | last post by:
Hi Guys, I find there is memory leak in our SQL 2000+SP3 databass. We have a client-server system, and the there are Jrun4.0 running JSP and someother Java application talks to the database. ...
7
by: Jon Trickey | last post by:
We migrated to 8.1 from 7.2 this weekend. Everything ran ok over the weekend, but we have a light user load then (about 200 users.) Today when we had close to 600 users connecting and running...
15
by: Chetan Raj | last post by:
Hi All, We have a web-application in asp.net that interacts with legacy code written in COM. The memory usage in aspnet_wp.exe increases every sec and never reduces. Using the .NET performance...
8
by: Sean | last post by:
I have a service that is pulling alot of records from a SQL Server table in a DataSet. This process takes up alot of memory, which is to be expected. But when the process is finished, I am clearing...
2
by: James | last post by:
Hi, I need help with a couple of questions, I have create and structure like: Structure byteArray Public byteA() As Byte End Structure Public ptrArray() As byteArray
6
by: comp.lang.php | last post by:
I have an image that's only 100K in size, and I am working with 8mb of memory. If I do this: print_r(ceil((int)ini_get('memory_limit') * 10 *...
6
by: CMOS | last post by:
consider the below code. it just creates a map and inserts 51000000 elements. when i check the memory usage , it shows an increase of memory after the loop. the increase is around 2mb. i used "ps...
2
by: Kevin McKinley | last post by:
# I posted a few days ago about a memory leak that I think i'm having with my first Tkinter program. # I've had trouble pinpointing what is wrong so i thought i would submit the code and see if...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.