Google Answers Logo
View Question
 
Q: "OutOfMemoryException" on .Net application ( No Answer,   4 Comments )
Question  
Subject: "OutOfMemoryException" on .Net application
Category: Computers > Programming
Asked by: massiep-ga
List Price: $100.00
Posted: 23 Nov 2004 07:58 PST
Expires: 23 Dec 2004 07:58 PST
Question ID: 432882
Hi, 
 
I'm running a .Net application that makes use of XML (including XSL
Transformations) and database access (SQL Server).
One of the batches I'm running keeps failing due to "OutOfMemoryException".
I've monitored it and saw that the problem occurs when performing a
transformation, loading XML Documents and when dealing with large
strings (~1.5M) - I gain between 3 to 30 M for each task in that batch
(in a loop).
I'm not concatenating strings, and using "string builder" whenever possible. 
I've tried calling "GC collect" and "wait for pending finalizers", but
it doesn't solve the problem.
I'm considering moving some of the processing to a different
AppDomain, and killing it after each use, but I don't like this
solution (which will probably cause new issues anyway).
I'm disposing of everything that is disposable (or that can be
"closed"), and now I'm caching files, and database tables into memory.
I don't use unmanaged code, and I'm looking for a way to decrease the
footprint of each task to less than 1M, or alternatively to gain
better control of the GC.
Thanks,
Massiep.
Answer  
There is no answer at this time.

Comments  
Subject: Re: "OutOfMemoryException" on .Net application
From: abdmanaf-ga on 25 Nov 2004 00:57 PST
 
are you using VB.Net?
There were stack size limitations in earlier versions of VB (Vb6)
Subject: Re: "OutOfMemoryException" on .Net application
From: massiep-ga on 25 Nov 2004 06:19 PST
 
No. I'm using C#.
Subject: Re: "OutOfMemoryException" on .Net application
From: sujitnair-ga on 26 Nov 2004 09:11 PST
 
it would help a bit my disposing off the connection or any other
reader object instead of just closing it. You can call the
connection.Dispose method to close the connection.
Subject: Re: "OutOfMemoryException" on .Net application
From: bueller90071-ga on 07 Dec 2004 23:42 PST
 
Could you post the c# code from your loop?  It would help us to
troubleshoot the issue.  Thx.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy