Last post Oct 07, 2008 11:15 PM by namelessguy
Sep 13, 2007 03:55 AM|jalikid|LINK
I have a asp.net 1.1 application deployed on an windows 2003 server. Sometimes, I got the error "Server unavailable", at that time I view the task manager and see that the w3wp.exe process takes more than 1G memory, and also the following event capture in
Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1013
Time: 1:08:20 AM
A process serving application pool 'AppPool .Net1.1' exceeded time limits during shut down. The process id was '2476'.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
The only thing I can do is restarting world wide web publishing servive.
Please help me.
Thanks in advanced.
w3wp.exe high mem usage
Sep 13, 2007 09:39 AM|javiguillen|LINK
Have you checked the code for infinite loops?
Sep 13, 2007 10:07 AM|OWScott|LINK
This can be difficult to troubleshoot. If you have a 32-bit server without the /3GB switch in boot.ini, your app pool should be maxing out around 800MB, so you're hitting the max the app pool can handle. In fact, if you say you're hitting 1GB, my guess
is that you have the /3GB switch set in boot.ini which doubles the RAM that any given worker process can use.
ASP.NET does have some handles into the site's app pool max memory limits. Try setting them to 800 each, (app pool's memory limits) then ASP.NET "might" notice the limit getting close and do some cleanup on unused memory earlier. (using the .NET garbage
It would be worth upgrading to ASP.NET v2.0 if you can. Chances are really good that your current site will run under 2.0 without any code changes.
Those are the 'fix and hope it works' changes that you can do. To really get into it, you'll need to find out what is using the memory. That can be difficult. One option is to break your site into applications and put each in their own app pool, then
find out which part of your site is causing the RAM to climb.
Knowing how fast it climbs and which pages are viewed as it climbs offers some clues. Ultimately, it will come down to the code though. There is something that is leaking memory or caching a lot of data which is causing the high memory usage.
Sep 14, 2007 02:16 AM|jalikid|LINK
@ javiguillen: I'm thinking about it, but hardly find out, I'm trying to narrow down the suspected codes. Anyway the system has run for more than 2 years, recently I've made some modification, but not sure if it's the reason. And also, I have 4 servers to
run the site as separated sites with only 1 server gets problem.
- My server is 32 bit but doesn't have /3GB switch in boot.ini.
- About the "site's app pool max memory limits". I think I can't not use it because when the mem usage up to the limit, the mem recycling happens and the logged-in status of all users looses, all the users must re-login - Am I right? If yes, then my system
can not accept this case - actually I don't know if the mem recycling can happen without loosing all users' state-session.
- I'll try to upgrade to 2.0 framework.
Thank you a lot for helping me.
Sep 14, 2007 10:38 AM|OWScott|LINK
The goal is that the GC will cleanup before it hits 800 you won't ever recycle. It's a stab in the dark though and would only work if the issue is with the GC not collecting early enough.
With your current issue, you're going to have the same issue. When you get that failure, you're going to lose your session state for all current users.
A workaround for losing the session state is to turn on the ASP.NET State Server service in windows and changing your web.config to use StateServer instead of InProc session state. This will allow it to survive an app pool recycle.
Upgrading to v2.0 is a stab in the dark too. Chances aren't that good that it will solve things. If it doesn't solve it, you'll need to find out what is using the memory and fix the root cause.
Sep 15, 2007 04:22 AM|jalikid|LINK
You're right, upgrading to 2.0 framework does not solve the issue. I'll try to use the asp.net state server service as you suggested.
Thank you a lot
Sep 15, 2007 06:49 PM|OWScott|LINK
I'm pleased to hear that you got your site running under v2.0. That's worth doing anyway. Too bad it didn't magically fix the issue though. The state server change won't help with memory (well except for the very small bit that session state takes up).
It will just help you keep your user sessions in place when the issue does happen. Also, it allows you to impliment the band-aid of recycling the memory at 800MB without losing sessions.
To find your memory intensive page(s) can be difficult. Can you create a test environment and manually test some pages over and over and see if the memory climbs? If you need to generate more load, try WAST which you can find on Microsoft's site. You
can simulate a ton of traffic which will hopefully allow you to reproduce the issue. Once you can reproduce the issue in a test environment, then start testing individual pages one by one until you find the cause.
Sep 16, 2007 08:50 AM|jalikid|LINK
Currently, StateServer helps me living a few days more. It's good for me, actually. I did some load test to simulate the real environment using WebLoad and Visual Studio Test suite, but the only phenomenon that I catch is: the memory usage increased only
to more than 200M, and after the test it didn't decrease. I'll do more test as your suggestion.
Thank you very much
Oct 07, 2008 11:15 PM|namelessguy|LINK
I might be a bit late to response to this post, but if are still experiencing the problem then try this link, it may help you: