High memory in a ASP.NET application - how to monitor, what can cause?

R

Ravi Ambros Wallau

Hi:
We have an ASP.NET application that has a memory consumption issue -
it's go up to 150 MB in a few time (some hours).
The application uses two Microsoft Application Blocks, the User
Interface and the Data Access. The User Interface block was highly modified
to support our needs. One of the changes is a process that "cleanup" unused
tasks, when a fresh new one is open. This works fine, but to deallocate the
old task I only remove it from a HashTable. Should I call Dispose()
explicitily?
Is there any known memory leak in ASP.NET? Is the UIPAB familiar to you,
I am wondering if someone has (or had) the same problem that I'm having
now...
And the other point is:
I also would like to monitor all active sessions that belong to my
application. Is this possible? And more, for each session, enumerate the
variables (this is easy), and have an idea of how many bytes are being
consumed in each entry (this is not so easy, I think)...

Any sugestions?
Thanks,
Ravi.
 
B

Bruce Barker

if you add objects to a hashtable that use unmanged resources (common reason
to implement IDispose), and the hashtable is the only reference, then you
need to call Dispose to free these unmanged resources, when you remove the
object from the hashtable (or clear the hashtable). the GC will call Dispose
eventually, but it may be a long time.

the usual trick to get the approximate size of an object is to serialize it
to a byte array, and check the array size. of course this requires the
object be serializable, and tell nothing about unmanged memory in use.

if you use the sos.dll with win32 debugger you get info about mamnegd and
unmanged memory.


-- bruce (sqlwork.com)
 
R

Ravi Ambros Wallau

Bruce:
All objects that belongs to all hashtables are managed (are standart
framework objects).
And the hashtable is the only reference to another class that as a lot
of things, including some hashtables. I think that when it's become
inacessible (by removing the only reference that exists, in the session
hashtable), it should be disposed.
I am thinking on this alternative (call Dispose manually), but I'm a
little afraid about the performance issues related with this operation.
All my memory is managed.
I would not like to serialize everything :-(. Too much process envolved
on doing this. The .Net framework doesnt know how many bytes a object is
using?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,913
Messages
2,570,027
Members
46,421
Latest member
WaylonBran

Latest Threads

Top