Virtual Bytes counter and IIS Virtual memory limit.

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Virtual Bytes counter and IIS Virtual memory limit.

Postby vitema » Wed Jun 08, 2011 2:41 pm

Hello! Please help!
My provider set virtual memory limit in IIS 7 - 96 Mb.

Now I have big problem with lost session state immediately after the start application...

IIS logs:
was-20110608.log:Jun 8 12:50:13 192.168.2.36 WAS: 5077: A worker
process with process id of '2576' serving application pool
'arlekino74.ru(domain)(2.0)(pool)' has requested a recycle because it
reached its virtual memory limit.
was-20110608.log:Jun 8 12:55:13 192.168.2.36 WAS: 5186: A worker
process with process id of '9692' serving application pool
'arlekino74.ru(domain)(2.0)(pool)' was shutdown due to inactivity.
Application Pool timeout configuration was set to 5 minutes. A new
worker process will be started when needed.

I tested the site and have not seen any potencial problems with memory leaks.

Image

But counter Virtual Bytes is very big - 236 Mb.
I also tested a simple empty page

aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
1231231
</div>
</form>
</body>
</html>
------------
cs:
using System;


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
-----

But even here Virtual Bytes counter is 178 Mb.

Image

-----

This counter actually shows the memory that IIS responds?


What advise do to solve this problem?


Thanks in advance
vitema
 
Posts: 4
Joined: Wed Jun 08, 2011 1:41 pm

Postby Brian Donahue » Thu Jun 09, 2011 5:57 pm

The Virtual Bytes counter rises sharply at application load, but remains pretty steady, so I don't think you have a memory leak -- maybe your application is just that big.

If the memory usage continues to increase over time, that is the kind of problem Memory profiler is good at solving.

But If your application does use that much memory, you may want to look at the health monitoring settings in IIS and configure the app to recycle at a higher memory usage.

I am guessing someone is already aware of these problems, because they have gone out of their way to configure health monitoring to put events in your event log.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Thu Jun 09, 2011 6:10 pm

I've also noticed that most of the memory usage is unmanaged code as well. Unless you can directly correlate that with a managed .NET class, it will be difficult to find any overuse of memory with ANTS Memory Profiler.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby vitema » Fri Jun 10, 2011 3:32 am

This is the problem.
I can`t configure the provider's IIS.
In Visual Studio and on two other providers I have no such problems.

And once again, that a blank site, which can not be big also occupies a large amount of virtual memory. And my application is not big - simple engine.

I can not find a starting point, the parameter on which to push off...
vitema
 
Posts: 4
Joined: Wed Jun 08, 2011 1:41 pm

Postby Brian Donahue » Fri Jun 10, 2011 9:11 am

What class (other than system.string) has the most instances?

I never look at String classes because in ASP .NET just about everything is converted to string.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Re:

Postby vitema » Fri Jun 10, 2011 9:41 am

Brian Donahue wrote:What class (other than system.string) has the most instances?

I never look at String classes because in ASP .NET just about everything is converted to string.





HashTable+ bucket Class is the second largest class

Root Instance for this class is UrlRewriting Section.
I using UrlRewritingNet.UrlRewriter.dll




Image
vitema
 
Posts: 4
Joined: Wed Jun 08, 2011 1:41 pm

Postby AndrewH » Fri Jun 10, 2011 11:41 am

'Virtual Bytes' represents the total address space reserved by your application. This doesn't actually represent the amount of memory that your application is using! The amount of memory being used by a given application is best represented by the 'Private Bytes' counter.

'Private bytes' represents the memory that is allocated and in use exclusively by a particular application. It's the most direct representation of 'how much memory does my application need'.

There are two things that are a major contributor to the size of the 'virtual bytes' pool: one is the shared DLLs and operating system structures that are mapped into the memory of your application. You have no control over this.

The second is space that is reserved but not in use. .NET reserves some address space so it can expand its heaps quickly when it needs to. This is generally pretty unnoticeable on 32-bit systems, but on 64-bit systems, there is a lot more address space to play with, so it reserves a chunk of 200Mb by default. This appears to be about the amount of Virtual Bytes that you are seeing, so that might point that your application is running in a 64-bit app pool.

I don't think there's any way to get an application to fit in a 96Mb virtual bytes limit. Even notepad requires 80Mb of address space to run. .NET requires about 20Mb of private bytes, plus whatever extra virtual bytes are needed to load the (shared) DLLs, so a .NET app is probably going to need at least 100Mb or so in order to display 'Hello, World'. (Note that this isn't 'used memory' but 'used address space', most of that is either reserved or shared between many application)

I think your ISP probably meant to give your application pool a 96Mb private bytes limit instead.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm

Postby vitema » Sat Jun 11, 2011 4:30 am

Thank you.
I think so too
I wrote ISP, that if they want to limit the problematic sites, then it would be wise to set limits on private memory or phisical memory...

I'll try to give a link to your comment
vitema
 
Posts: 4
Joined: Wed Jun 08, 2011 1:41 pm


Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 0 guests