I have a web application which throws a ThreadAbortException when
trying to read a 7 megabyte (approximate) spreadsheet. My application
will throw an HttpException to the client, but the inner exception is a
ThreadAbortException during Aspose.Cells.Workbook.Open().
I need to find out what may be causing the error, and how it might be avoided. I don’t have the luxury of catching and ignoring a failed Open() in my application.
[I have a sample web app which demonstrates the problem, but how do I forward it?]
The app is running on the following platform:
Windows 2003, Web Edition, Service Pack 1
ASP.NET version 1.1.4322
IIS version 6
2 Gig available ram
Aspose.Cells.dll version 3.9.1.0
Another key detail: In the web.config, the following entry must be set to “false” to make the error occur:
When debug=“true”, the program will successfully load all five sheets.
When it fails, the program will fail when attempting to open the fourth workbook. It will not fail when running on Windows XP with IIS 5. It does not fail when openning smaller spreadsheets, though I am not sure of the size threashold.
(Please note, I have only one workbook in the sample…be
sure to copy it to four other copies named sample2.xls, sample3.xls,
etc etc, if you use my sample app.)
Thank you very much!
It seems that it's a configuration problem. I don't have a window2003 on hand so I cannot test it.
Generally I think you should assign more memory to IIS.
Please check `http://weblogs.asp.net/guys/archive/2005/04/30/405097.aspx`, is it possible that you set memory limitation for work process which causes IIS to recycle the memory?
After implementing the recommendations discussed in the link you offered, the problem still remains. Using adsutil.vbs, we enabled logging of all application pool resets and determined that at no time was the application being reset due to memory consumption. So perhaps that’s not the exact issue we’re dealing with.
With the debug=“true” set in our web.config, which is when our application is abe to handle larger excel files, I’ve recorded peak memory usages as high as 500 Meg. This was done using task manager to watch memory usage during operation of the web application.
We’re stuck, at this point. Is there any way you can accept my sample code and inspect the problem in a Windows 2003 environment of your own?
Thank you…
Thanks for you sample application.
1. Please don't set license in Page_Load event handler, that will cause many unneeded SetLicense calls. You can put it in Application_Start event handler.
2. In your code, you will concurrently open 5 files with all about 7MB size? That causes your program consume too much memory.
Generally Aspose.Cells will use about 15-20 times memory size compared with file size. So 5X7=35MB file will consume about 500MB memory.
The solution to your problem are:
1. Extend IIS memory size as large as possible.
2. Open only one file at a time and make your files as small as possible.
Hi Laurence,
After some time I’ve had an opportunity to review our application which originally causes the problem I’ve noted above. In our production application, unlike the sample I sent to you, we only open one workbook, which is approximately 9 MB in size. A single file. By your calculation that would consume 45 MB once loaded.
This problem occurs in two environments, both Win 2003/IIS 6, with 2Gig and 4Gig of physical memory available respectively. Also recall that the problem only occurs when the debug value of FALSE is used in the web config of the application.
We have no control over spreedsheet filesize, since the content is driven by out customer’s choices.
Is there any alternative solution? It appears that we’ve hit a limitation which prevents us from scaling our product to a larger audience.
-John
Dear John,
I had tried your case in a Win2003/IIS6 without any problem. And my machine only have 512MB memory.
Since your program works fine the the debug value of TRUE, I think that must be a problem in your configuration. Maybe you have to ask Microsoft about this problem.
Hi Laurence,
Thank you for that information. We now plan to isolate our application on a clean Win '03/IIS 6 machine, with standard settings “out of the box”. Is there anything special that you did or had run, in your environment, that we may need to pay attention to?
Thanks!
No any special settings. Our test machine also use all default settings.
This is a very strange problem. No other users had reported it. And some of them also use Aspose.Cells with large workbooks.
If you still find the problem in a clean machine, please post your test project here. And please let me know the whole detail error message and your configurations. Thank you.
Hi,
Hi,
Thank you for considering Aspose.
Please try the attached latest fix of Aspose.Cells. If you still face any problem please create a sample application to reproduce the issue and post it here. We will check it soon.
Thank You & Best Regards,
Thanks for the reply, I will come back with an update as soon as available.
Best regards,