I've seen suggestions that GC.Collect be called when done with large chunks of memory or large complex objects that are only allocated once per invocation. [1, 2, 3]
[1] http://blogs.msdn.com/ricom/archive/2004/11/29/271829.aspx [2] http://blogs.msdn.com/scottholden/archive/2004/12/28/339733.aspx [3] http://msdn2.microsoft.com/en-us/library/y46kxc5e.aspx On Fri, 19 May 2006 09:31:33 -0700, Steve Welborn <[EMAIL PROTECTED]> wrote: >Good Afternoon and Happy Friday! > > I have created an ASP.Net page that takes any amount >of rtf >documents and combines them into one. The rtf >documents are chosen by the >client from a list, and the list contains about 33 rtf >documents. I don't >use automation or anything like that just simply open >the file and transfer >all but the first 101 characters(which is the rtf >header) and the last '}'. >It seems to work just fine until all 33 are selected >then I get 'Out of >Memory' errors and IIS crashes. The average file size >for the rtf is 18meg. >I see IIS go from the normal 50meg all the way up to >510megs, then it >crashes. I venture to say it could be because garbage >collection hasn't >started actually releasing the now closed files from >memory. I AM setting my >file and stream readers to null when im done. > > My solution that I am playing around with is >this: > Build a webservice(not true 'service' per say, dll >in IIS) >that listens for a request > from the website. The Website passes in an >Object[] that >contains all the information it needs to combine the >documents. > > The webservice takes care of opening and writing to >the >final document with all selected rtf files included. > > The website waits until the Webservice sets the >'Complete' >to true. Then shows the Complete page. > > The reason for this solution was that maybe a Windows >type >application will utilize the memory better than an >ASP.Net app would. > > I was also thinking of maybe using a Windows type App >like this >because I could then use the RTF Control in Windows >and open and modify the >Rtf files from there, this way I don't have to loop >through the whole file >and possibly making it faster. > > > Does it sound like a viable solution? I cant use >Automation because, >as well all are aware, Word is a memory hog and each >time someone access the >page it opens an instance of Word. Not to mention they >don't want to install >Word in the server. There are going to be at least 20 >people creating these >documents at any given time. > > Any help or advice would be greatly appreciated. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
