Memory Problems

G

Guest

Hello, I have a fairly simple application which reads none to many input
files and edits them and if they are clean, it writes these transaction to
the database. Any errors it finds, it opens and error file and writes the
error message and the error transaction to this file. After the processing
of the file is complete, it will copy the original file to an archive
directory and then delete the original file.

The problem is that after processing about 25 files, it runs out of memory.
So I must be doing something wrong to cause the memory to continue to climb,
as it seems that it should reach a point where memory usage should level off
as it is doing the same thing over and over.

I am waiting until all the transactions from the file have been processed
until I do a commit (Oracle, not on the local box) which could be a couple of
thousand transactions, but I have been told that this should not have an
impact on my performance or memory use.

So how does one go about finding out why their memory usage continues to
climb?

Thanks in advance for your assistance!
 
N

Nicholas Paldino [.NET/C# MVP]

Jim,

Without seeing your code, it's hard to say. Are you getting this
through just looking at Task Manager? Task Manager is not a good indication
of whether or not you are actually running out of memory or consuming too
much or whether there is a leak.

As a general guideline, you should make sure that you are disposing of
any instances that implement IDisposable. Also, are you loading all of your
data in extra large chunks (for example, loading large files into a byte
array before processing them)? If so, you might want to consider processing
a segment at a time (reading from a stream, for example).

Hope this helps.
 
B

Bhargavan

Hey Jim,
There is a tool called Memory Profiler available on the
internet(http://www.scitech.se/memprofiler/). Try to get that and see how
your application performs. It will list all details about the unreleased
memory by each control/component in your application. That will give you a
better idea about any memory leaks in your application. Hope this would help
you.
Bhargavan M.
 

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

Similar Threads

C# File + DB Transaction 2
Memory Problem Again 8
strange memory problem 2
Re using Stored Procedures 8
linq transactions 9
visual studio memory utilization? 7
Can't access memory stick 6
Out of memory 4

Top