Out of memory exception

C

chembeti.aravind

Hi,

I have a C# Windows Form based application that has to create hundreds
of excel files. (At least some 500. This is minimum.)

When I ran this application, it threw "Out of memory exception" after
creating some 55 files.

Code calls all relevent APIs (Quit, Marshal.ReleaseComObject, etc and
finally excel application was set to null.). But still I get this
problem.

I observed, calling Quit and setting to null, does not immediately
delete Excel.Exe from Task Manager.

Any ideas would be greatly appreciated.

Thanks in advance,
Aravind
 
M

Madhan

Hi, in my opinion, if you introduce a slight delay before your loop continues
its next iteration, it should solve the issue. Also, you should release all
the intermediate objects you created within your loop. Further, please ensure
that you have not declared any variables within the loop. I hope these tips
help you.
 
C

chembeti.aravind

Hi, in my opinion, if you introduce a slight delay before your loop continues
its next iteration, it should solve the issue. Also, you should release all
the intermediate objects you created within your loop. Further, please ensure
that you have not declared any variables within the loop. I hope these tips
help you.











- Show quoted text -

Hi Madan,
Thanks for the reply. But I have already followed all those
techniques. I am properly releasing all variables calling
ReleaseComObject(), set them to null and called Quit() on
Excel.Application.

After creating 10 excels, I introduced some delay. But nothing worked
out. Some times it is throwing "Unknown Software Exception". I am
using VS2005 Team Edition.

Any iedas???

Regards
Aravind
 

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

Top