aspnet_wp.exe

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
May01
Posts: 3
Joined: Wed Sep 17, 2008 5:18 pm

aspnet_wp.exe

Post by May01 » Wed Sep 17, 2008 5:29 pm

I tried to run a complex .net application. The issue is the aspnet_wp.exe memory usage increases with each request. But it never releases memory. So I used .net memory profiler. I ran the application once, did a few activities, close it. Got a snapshot. Then I ran the application once again, did the exact same and close the browser and got a snapshot. In the real time graphs and statistics, the total bytes is 65,905,182 and the live bytes is 65,891,786. The graph lines are almost the same.

It also shows: Gen #0: 137 Gen #1: 54 Gen #2: 16

Namespace Name Live instances New live instances Removed live instances Delta live instances Disposed instances New disposed instances Removed disposed instances Delta disposed instances Undisposed instances Delta undisposed instances
Unchecked Aspose.Grid.Web TableItemStyle 60244 30122 0 30122 60244 30122 0 30122 0 0
Unchecked System.ComponentModel EventHandlerList 16 8 0 8 14 7 0 7 22491 9261
Unchecked System.Web.UI Control.OccasionalFields 14 7 0 7 2 1 0 1 23 10
Unchecked Aspose.Grid.Web.Data WebWorksheet 12 6 0 6 10 5 0 5 2 1
Unchecked System.Web HttpApplication 2 1 0 1 0 0 0 0 0 0
Unchecked Aspose.Grid.Web Worksheet 2 1 0 1 0 0 0 0 81 39

Am sorry this doesn't paste very well :-).

Do you think there is a memory leak here? Why the memory usage goes high because of the aspnet_wp.exe?

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Thu Sep 18, 2008 9:03 pm

Since you have a lot of new disposed instances and no removed instances, it indicates that you might have a memory leak. I suggest that you investigate the details of the classes that have new disposed instances. Maybe the WebWorksheet class is a good candidate for initial investigations, since there's not that many new instances. Double-clicking the WebWorksheet row in the Types view will bring up the details for that class. To view the details of a specific instance, double-click one of the new disposed instances. In the instance details view, you will get information about the root paths to the instance. The root paths will tell you why the instance has not been collected.

If you need some additional help, include one of the root paths in a reply to this message. Hopefully I will be able to provide some additional information.
Best regards,

Andreas Suurkuusk
SciTech Software AB

May01
Posts: 3
Joined: Wed Sep 17, 2008 5:18 pm

Post by May01 » Thu Sep 18, 2008 10:50 pm

Thank you very much. Here is the instance detail I'm getting

default_aspx.__BuildControlWorksheet1()
default_aspx.__BuildControl__control3(WebWorksheets)
default_aspx.__BuildControlGridWeb1()
default_aspx.__BuildControlform1()
default_aspx.__BuildControlTree(default_aspx)
default_aspx.FrameworkInitialize()
Page.ProcessRequest(bool, bool)
Page.ProcessRequest()
Page.ProcessRequestWithNoAssert(HttpContext)
Page.ProcessRequest(HttpContext)
default_aspx.ProcessRequest(HttpContext)
HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
HttpApplication.ExecuteStep(HttpApplication.IExecutionStep, bool&)
HttpApplication.ApplicationStepManager.ResumeSteps(Exception)
HttpApplication.ResumeSteps(Exception)
HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext, AsyncCallback, object)
HttpRuntime.ProcessRequestInternal(HttpWorkerRequest)
HttpRuntime.ProcessRequestNow(HttpWorkerRequest)
HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest)
ISAPIRuntime.ProcessRequest(IntPtr, int)
[Unmanaged to managed transition]

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Sat Sep 20, 2008 8:12 am

The details you posted is the allocation call stack. The call stack will not provide information about why the instance is not collected, just how it was created. The root paths are presented in the list above the allocation call stack. Can you provide me with one of the root paths (e.g. the first one)?
Best regards,

Andreas Suurkuusk
SciTech Software AB

May01
Posts: 3
Joined: Wed Sep 17, 2008 5:18 pm

Post by May01 » Sat Sep 20, 2008 3:27 pm

Is this the one???

System Object[]
System.Collections ArrayList
Aspose.Grid.Web.Data WebWorksheets
System.Collections.Specialized NameObjectCollectionBase.NameObjectEntry
System Object[]
System.Collections ArrayList
System.Web.SessionState SessionStateItemCollection
System.Web.SessionState InProcSessionState
System.Web.Caching CacheEntry
System.Collections Hashtable.bucket[]
System.Collections Hashtable
System.Web.Caching CacheSingle
System.Web.Caching CacheExpires
System.Threading TimerCallback
System.Threading _TimerCallback
<root>

Thank You.

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Mon Sep 22, 2008 8:21 pm

The information provided by the root path indicates that the WebWorksheet is stored in the Session state of the ASP.NET application. And the allocation call stack suggest that a new WebWorksheet is created on each page request. I don't know much about the Aspose grid control (I just had a quick look at the online documentation), so I don't know why a web control instance (WebWorksheet) is stored in the session state. But if a new WebWorksheet (including a lot of cells I assume) gets added to the session state on each page request, without being removed, then there will be a memory problem.

Considering the small amount of information I have (and no knowledge about the Aspose grid), it's hard to a good analysis of this problem. But I recommend that you continue to investigate the creation of WebWorksheets. E.g. is a new WebWorksheet created on each page request? If you are able to create a small repro that exhibits the problem, you can send it to us at support@scitech.se and we will take a look at it.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests