ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Out of memory exception (https://www.excelbanter.com/excel-programming/386104-out-memory-exception.html)

[email protected]

Out of memory exception
 
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


Madhan

Out of memory exception
 
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.

" wrote:

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



[email protected]

Out of memory exception
 
On Mar 28, 4:01 am, Madhan wrote:
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.



" wrote:
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 "Outofmemoryexception" 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- Hide quoted text -


- 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



All times are GMT +1. The time now is 05:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com