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?
 
kmotawehConnect With a Mentor Commented:
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
 
jderaConnect With a Mentor Commented:
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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
 
kmotawehConnect With a Mentor Commented:
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
 
PlaceboC6Connect With a Mentor Commented:
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
 
tgtranConnect With a Mentor Commented:
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
 
oyvindhaConnect With a Mentor Commented:
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
 
kmotawehConnect With a Mentor Commented:
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
 
MeviConnect With a Mentor Commented:
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
 
MeviConnect With a Mentor Commented:
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
 
tgtranConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.