Restarting Windows 2003 when memory gets low

I have a memory leak in a web service thta I am trying to resolve.  Meanwhile, I must restart my system every three or four hours to keep the performance adequate.

Is there a way to auto restart the system when memory gets below a certain threshold?  This capability would allow me to leave the facility during the test period, before I find the cause of the leak.

Any ideas??

thanks,
newbieweb
newbiewebSr. Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kmotawehCommented:
if you know the period between the leak you can put a schedueled task with a batch file containing the following command ( shutdown -r -t 01 ) and scheduele it to run every 3 or 4 hours
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jderaCommented:
This might be a better option:

http://support.microsoft.com/kb/317371

0
newbiewebSr. Software EngineerAuthor Commented:
Is there a way to make shutdown contingent on the amount of memory available?
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

newbiewebSr. Software EngineerAuthor Commented:
DO I type "shutdown -r -t 01" at the command prompt?  I actually want a restart.  How do I do that?

How do I schedule the command to run every three hours?
0
kmotawehCommented:
make a text file and rename it's extension to .bat  and right click on it and choose edit and copy the command without the qoutes offcourse and paste it on it and close it ans save it and go to accessories and from it choose the schedules taskes or the task scheduler and create a new task with the .bat you have created and set the schedule to run as u like
0
newbiewebSr. Software EngineerAuthor Commented:
also, I need the machine to restart whether I log into my account or not.  The web service starts so can I get it to restart when no one is here to log into the machine??

newbieweb
0
PlaceboC6Commented:
Can't you just create a scheduled task to periodically restart the IIS services?
0
newbiewebSr. Software EngineerAuthor Commented:
As far as I know, that would not help.  The Page File Usage is near the maximum and needs a system reboot.

And, instead of "shutdown -r -t 01", can I use "restart -r -t 01"?

And will this execute if I never log into my account?  Something tells me it will not.  I need this restart to be automated and hands free.

Please advise...
0
TG TranIT guyCommented:
There is no built-in command "restart" - you need to use shutdown.  If you scheduled it as a task, you would have to enter credential and it will use that credential to reboot without needing you to login.
0
oyvindhaCommented:
Like tgtran said, there is no reboot command. But using "-r" with the shutdown, means you will reboot.

Other than that, I'm not aware of any possibility to restart based on the amount of memory being used.
0
kmotawehCommented:
there's not command called restart and the -r option on the shutdown command means restart and -t switch of the cpommand to give it the time before restart if you want to run it on another pc and needs the user to have sometime to save it's work and 01 means one seconed because you don't need the time to save
0
MeviCommented:
If its a webapp that is causing the server memory to get low, use web.config to automatically recycle the process.  We had to do this with a vendors app once.  Unfortunately, I do not recall the exact setting in web.config that automatically restarts the process when it is unresponsive for x seconds.

HTH

0
MeviCommented:
Also if it is just the webservice, you can always just restart the "world wide web publishing service" manually.  

Make a batch file that contains the following so you can do this quickly when logging into the server.
net stop "World Wide Web Publishing Service" && net start "World Wide Web Publishing Service"

Open in new window

0
TG TranIT guyCommented:
Follow Mevi's post if you want to restart just WWW.  However, if you want to restart IIS, you may want to use the "iisreset" command.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.