Re: Memory leak when using Response.Write()



I don't know if this would have a dramatic effect, but if you're using
DataTables, and reusing them instead of creating new ones, then in
addition to doing a [DataTable].Clear();, I would also do a
[DataTable].Columns.Clear();. I've found instances where row data was
removed, but there was still column data remaining. However, I think
you would have noticed that in the data you used and displayed. Good
luck.

JT

Piotrek wrote:
But memory is not released even when I explicitely call GC.Collect()
method.

I know that there should be sawtooth like curve. And it is like that
but with one exception: numer of live object instances is continously
getting bigger e.g. when my app. starts then there is about 100 live
objects. During work with the app this number is getting bigger to
let's say 500 objects. Then memory collection is called, but after it
there is still about 150 objects (50 more than there should be) - .NET
Memory Profiler says that there is a lot of strings, many DataColumns
and few DataTables and DataSets, which are not collected.

As a result IIS has to be periodically reseted to free all allocated
memory (even 5 times a day).

.



Relevant Pages

  • Re: Persisting a Dataset
    ... I'm not sure you're going to get around the memory issue without possibly ... which would load the table into memory and serve all the exes. ... > I have a Windows Forms app deployed on Terminal Server. ... One of these datatables has about 5000 ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Persisting a Dataset
    ... > which would load the table into memory and serve all the exes. ... >> I have a Windows Forms app deployed on Terminal Server. ... One of these datatables has about 5000 ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Persisting a Dataset
    ... >> which would load the table into memory and serve all the exes. ... >>> I have a Windows Forms app deployed on Terminal Server. ... One of these datatables has about 5000 ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Memory leak when using Response.Write()
    ... But memory is not released even when I explicitely call GC.Collect ... During work with the app this number is getting bigger to ... Then memory collection is called, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Persisting a Dataset
    ... it seems like the bulk of your memory would be taken up ... > datatable contains a list of possible medical diagnosis codes. ... >> which would load the table into memory and serve all the exes. ... One of these datatables has about 5000 ...
    (microsoft.public.dotnet.framework.adonet)