Antonio,
No, you shouldn't be calling GC.Collect, ^especially^ in an ASP.NET
environment. ASP.NET gets into a nice little groove (in terms of GC's, and
when the pattern of use is consistent) which you don't want to mess with by
running your own GC's.
The errors that you are probably getting are due to the % of memory
ASP.NET is allowed to use before the process is recycled. You would have to
up this value in the web.config file for your application, to let your
ASP.NET process take up more memory.
If your report is returning data that is between 200-500 MB, then you
really need to reconsider the design of the report.
Also, Task Manager is not really suitable for monitoring the memory
consumption of an application. You should be using the performance counters
to determine what is being consumed/released, etc, etc.
In the end, ^don't^ call GC.Collect, as in this case, it isn't going to
do anything for you. Just make sure you dispose of all types that implement
IDisposable, and if your report is really that big, then raise the value of
the allowed memory consumption in the web.config file.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Antonio" <bl*****@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hello, here is what I am doing.
1) user accesses web page and clicks button to build report
2) web page accesses web service whose data type is DataSet
(public DataSet methodname()...)
3) web service connects to SqlServer, runs BIG report
4) data is returned to web service, web service returns DataSet to web
front-end
5) web front-end prompts user to save Excel file which contains the
DataSet data
While #3 is running, the aspnet_ws.exe process on the web server grows
big, like 200-500 MB.
The problem is the server doesn't seem to release that memory after the
report is done. A few more report runs and the server starts giving
memory errors.
I have seen people saying use GC.Collect() but where would I put that?