|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
High memory in a ASP.NET application - how to monitor, what can cause?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. 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) Show quote "Ravi Ambros Wallau" <rwal***@springwireless.net> wrote in message news:%23kD9M3GGGHA.3864@tk2msftngp13.phx.gbl... > 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. > 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? Show quote "Bruce Barker" <brubar_nospamplease_@safeco.com> wrote in message news:OCEaWIHGGHA.2676@TK2MSFTNGP10.phx.gbl... > 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) > > > > > "Ravi Ambros Wallau" <rwal***@springwireless.net> wrote in message > news:%23kD9M3GGGHA.3864@tk2msftngp13.phx.gbl... >> 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. >> > > |
|||||||||||||||||||||||