We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Question about file size and Workbook.Open

Hello there,

I am not sure you can provide any input on this issue. This issue we are having we have really narrowed down to one box. We have a file share that has excel files on it that I create out of process from IIS and the web files that range from 40 - 95 meg. On this one box once we try and do a workbook.open on a 90 + meg file we get an system out of memory exception immediatly when it hits the workbook.open line. It is only on this one box running IIS 6 but I tested on another IIS 6 box with no issues. It is very odd though because it opens anything under 90 meg and I tested a ton making the file under 90 meg and it works like 87 meg etc. once I hit 90 or a little over it happens every time, Any idea what we should look for? What is the max capacity size this is the error I am getting:

----------------------------------------
Timestamp: 1/8/2009 7:02:48 AM
Message: User : Sam Iqbal
Message : Exception of type ‘System.OutOfMemoryException’ was thrown.
Source : mscorlib
StackTrace : at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Aspose.Cells.ૅ.ᵎ(Stream ᵏ, Stream ᵐ)
at Aspose.Cells.Ss.᳷.ᴃ(MemoryStream ᴄ, Boolean ᴅ, Int32& ᴆ)
at Aspose.Cells.Ss.᳷.ᴃ(MemoryStream ᴄ, Boolean ᴅ)
at Aspose.Cells.Ss.᳷.ᴀ(ൔ ᴁ, ᵝ ᴂ)
at Aspose.Cells.Ss.᳷.᳿(Stream ܡ)
at Aspose.Cells.Workbook.Save(Stream stream, FileFormatType fileFormatType)
at Reporting_K1SummaryCheckOut.btnCheckOut_Click(Object sender, EventArgs e)
TargetSite : Void set_Capacity(Int32)
Environment.StackTrace : at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Utility.ReturnError(Exception ex, String strUserName)
at Reporting_K1SummaryCheckOut.btnCheckOut_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.reporting_k1summarycheckout_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)

Category: General
Priority: -1
EventId: 1
Severity: Information
Title:
Machine: PRECISIONDEV03
Application Domain: /LM/W3SVC/1/Root/Blackstone-1-128758717078186250
Process Id: 2528
Process Name: c:\windows\system32\inetsrv\w3wp.exe
Win32 Thread Id: 1824
Thread Name:
Extended Properties:
----------------------------------------

It seems that when opening a file more than 90MB size, it reaches the memory limitation.

We will try to optimize the memory usage. However, I think 90MB Excel file is too huge for a web application.

Agreed totally but now we are in a real bind where we need a quick solution for now. Anything you can help to optimize the memory utilization would help. It seems though as soon as it even tries to open the file it throws the error immediatly on one box. On another it throws it after a while, then on my Vista IIS 7 box it works no problems.

As of this morning we have totally isolated the issue that over a certain meg size such as after 70 meg the API throws a System out of memory error. The smaller files all work just fine on the workbook.open even up to the 50 meg range. This is a crucial issue we are dealing with as I really pushed our project group to use your API’s, please let me know if you can change anything or any max capacity is being set in your API. Thanks for any help you can provide as we are trying to make a deadline and this is really a critical issue for us at the moment.

If you could also try to replicate the issue by the following code using a 80-90 meg file on IIS 6 if possible.

Dim workbook As Workbook = New Workbook()
workbook.Open(FilePath)

'Open for client
Dim stream As New MemoryStream()
workbook.Save(stream, FileFormatType.Default)
Response.ContentType = “application/vnd.ms-excel”
Response.AddHeader(“content-disposition”, “attachment; filename=test”)
Response.BinaryWrite(stream.ToArray())
Response.Flush()
Response.Close()

I really can’t attach my 90 meg excel file as it has a lot of proprietary information in it, so hopefully you can try something on your end.

Also one last thing I want to add, last night all I had was the workbook.open and respone.write(“made it here”) and just on the open of the larger 80-90 meg files it was immediatly throwing the system out of memory error. Just FYI that it seems not to just be the memory streaming that is the issue.

Hi,

Thanks for providing us further details,

We will soon look into your issue.

Thank you.

Also just another piece of information, we also have Gembox another API, the problem with Gembox is it throws invalid formula errors on lots of things and cant create the file, that is why we actually tried your API. Now Gembox does work and it can open the 90 meg file same exact code base just a workbook.open and and stream without an issue. But we can’t use Gembox due to the formulas issues, so we need your team’s help on fixing your API and the way it opens the file up etc. if possible. I really don’t want to use another product so I am hoping your team can resolve this. Thanks again