Evaluating memory used by a DataTable

  • Thread starter Thread starter Strange Cat
  • Start date Start date
S

Strange Cat

Hi everyone!

I have a web app that loads into Session Memory a datatable object.

I'd like to evaluate the memory used by the datatable object before loading
it...

I would iterate thru all records accepted (because there is a filter on it)
using a DataReader and just sum the memory used by each record accepted...

Any other ideas?

Thanx in advance

ASC
 
Hi Strange,

Nope, you have to traverse all the records to calculate the ammount.
Btw, why would you need it to?
 
Hi,

I think you need to use some additional tools to do this. One is a
Performance Monitor from the Windows. you also could use Devpartner Studio
tool from Compuware to analyze memory. It is a pretty good tool, but it is
not free
 
Hi Strange,

Thanx for the answer Miha!
Nope, you have to traverse all the records to calculate the ammount.
Btw, why would you need it to?

I have a quite complex asp.net app.

There is a reporting tool in this app, and after the user selects a report
data is fetched from the db and saved into session memory, then a page with
the number of extracted records is shown and IF the user wants he can click
on a link that downloads a PDF/Microsoft Word report to a newly opened
window, otherwise he just hits cancel and session data is released.

The problem is that if the data is very big, the memory consumption is too
high and ASP.NET process gets recycled...

What I'd like to do is to evaluate the memory used by the extracted records
and (if it is too big) show a error message saying to refine the search...

BTW. Do you know how to read the thresold of max memory used before recycle
(default 60%) programmatically???

Thanx

ASC
 
Back
Top