w3wp.exe Allocating Over a Gig of RAM

T

Tod Birdsall

Hi All,

The organization I am working for has created a new corporate website
that used Microsoft's Pet Shop website as their coding model, and
dynamically served up content, but cached each page by content ID. The
site appears to be working well. It is hosted on a Windows 2003 server
with 2 Gigs of RAM. It was built using Visual Studio .NET 2005 and us
running under the .NET Framework 2.0 Beta

The Issue :
When we surf the website we see a wswp.exe startup and the memory
allocated to this worker process continues to climb as more and more
people access the site. This would appear to be a normal thing, but
this memory is not noticably released.

To give you an example, we ran a test using WAPT. We had 100 users
access the site 5 seconds appart, with a delay of 7 seconds on each
page they accessed. We ran this for about 20 mins, and the w3wp.exe
allocated about 1.1 gig of RAM. This seems like a bad thing, but not
out of the norm.

To give you an example of what I mean, we ran a similar test using a
very vanilla asp.net site, and the memory allocation for the w3wp.exe
went up more slowly, but did not get released.

I ran CLR Profiler against the new corporate website, and found what
would appear to be a small memory leak that we eliminated.
System.String is allocating around 25% - 30% according to the Objects
By Address portion of the CLR Profiler report, but this seems to be the
norm, comparing it to the same CLR Profiler report for the vanilla
website mentioned above. Looking at the Objects By Address report, very
little is surviving to gen 2, so I think we can eliminate memory leads.
We are not appear to be doing any string concatination without using
StringBuilder.

My Question :
Is this the norm? Have you experienced similar results? What has been
your solution. Are Application Pools the answer? If so, what should the
settings be? Is their a document that would help us in adjusting the
settings?

Thank you in advance for taking the time to read through this post.
Tod Birdsall
http://tod1d.blogspot.com
 
B

bruce barker

are you using inproc sessions? if so, look at your session usage. as be sure
you are not leaking an unmanaged resource (say a com object - you must
manualy release the references, don't count on the GC).

-- bruce (sqlwork.com)


| Hi All,
|
| The organization I am working for has created a new corporate website
| that used Microsoft's Pet Shop website as their coding model, and
| dynamically served up content, but cached each page by content ID. The
| site appears to be working well. It is hosted on a Windows 2003 server
| with 2 Gigs of RAM. It was built using Visual Studio .NET 2005 and us
| running under the .NET Framework 2.0 Beta
|
| The Issue :
| When we surf the website we see a wswp.exe startup and the memory
| allocated to this worker process continues to climb as more and more
| people access the site. This would appear to be a normal thing, but
| this memory is not noticably released.
|
| To give you an example, we ran a test using WAPT. We had 100 users
| access the site 5 seconds appart, with a delay of 7 seconds on each
| page they accessed. We ran this for about 20 mins, and the w3wp.exe
| allocated about 1.1 gig of RAM. This seems like a bad thing, but not
| out of the norm.
|
| To give you an example of what I mean, we ran a similar test using a
| very vanilla asp.net site, and the memory allocation for the w3wp.exe
| went up more slowly, but did not get released.
|
| I ran CLR Profiler against the new corporate website, and found what
| would appear to be a small memory leak that we eliminated.
| System.String is allocating around 25% - 30% according to the Objects
| By Address portion of the CLR Profiler report, but this seems to be the
| norm, comparing it to the same CLR Profiler report for the vanilla
| website mentioned above. Looking at the Objects By Address report, very
| little is surviving to gen 2, so I think we can eliminate memory leads.
| We are not appear to be doing any string concatination without using
| StringBuilder.
|
| My Question :
| Is this the norm? Have you experienced similar results? What has been
| your solution. Are Application Pools the answer? If so, what should the
| settings be? Is their a document that would help us in adjusting the
| settings?
|
| Thank you in advance for taking the time to read through this post.
| Tod Birdsall
| http://tod1d.blogspot.com
|
 
S

SA

Tod:

A) Please realize that at this time, there is not "Go Live!" license
available from Microsoft. Therefore, running this site is a violation of the
license agreement.

B) You (or the programmers) are allocating over a Gig of RAM, not the
process itself. In other words, it's your code. You may want to check
exactly how much memory you are using, e.g. because of large DataSets, etc.

Running the beta version may also influence the memory usage, as there is a
lot of debug code present.

You must also understand the way Windows manages memory. Even though the
memory may be released correctly by the .NET runtime, Windows may still
assign a higher amount of memory to the process, especially if there is no
other process requesting memory. This has to do with the OS's memory
management, and it's more intricate than .NET Garbage Collection.

If this is posing a problem, put the site in an application pool and recycle
the pool after a certain number of requests. (Realize that this causes
session state to be flushed as well...)

HTH,
 
T

Tod Birdsall

Hi Bruce,

I we are not sessions for the portion of the site we are testing, and
we eliminated the unmanaged code portion when we eliminated the memory
leak.
 
Joined
Feb 3, 2008
Messages
1
Reaction score
0
How to CLR profile w3wp.exe

Hi Tod

I understood from your post that you have profiled the w3wp.exe process with some CLR profiler.

Can you please as much as you can details on that subject, as I want to do that too... Thanks!
 
Joined
Apr 12, 2008
Messages
1
Reaction score
0
memory

I am in the same situation. The w3wp.exe processor increases as user became jumping from one page to another and worse, when I use crystal reports, the memory increase faster than any situation before.

When the website is left with no visitation for about 20 minutes, the windows release the w3wp.exe processor. But, if many users access the web site all togther, the system crashes!

This is terrible... I know asp.net and the .net has many advantges and it is easer to design and build projects but, in the final moment, when you deploy the application, we see this terrible things.
This makes me crazy. Now, I'm renting a Virtual Private Server with 512 of ram. And I can tell you, if the site gets 10 uses opening pages over pages, the VPS freezes.

I still on research to find out a solution. One thing you can believe, my application follows the best practices and it has a good software engeneering.

I feel terrible about that and, afther almost 7 years working with .net, I starting think about using the classic ASP for hosting in the internet.
 

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,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top