Solved

Script / App to Restart (Kill then Start) Specific Processes if They Exceed X Amount of Memory

Posted on 2014-11-02
2
337 Views
Last Modified: 2014-11-08
Hey Guys -

My home server hosts many different things.  By no means is it lacking in resources or out of date, but I simply have so much running on it that I'm looking for a specific solution to an issue.  

I have 2-3 processes which a few hours after start-up/reboot start using way more RAM then they need for various reasons.  What I'm needing is simple:

I'm looking for a script or application where I may designate these processes (by name, PID, whatever) and set a RAM limit for them.  At any time if they pass this limit, the process will be killed, then started back up again (with probably ~10 seconds in between.)

System Specs
- Windows 8.1 Update 1 x64
- i7 3770k / 16gb RAM
- Windows 8.1 Update 1 x64

Any thoughts or ideas for the best, most reliable & safe way to approach this?   Thanks!
0
Comment
Question by:BzowK
2 Comments
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40418222
There is no safe method to do this when you're asking to kill a process. That's why it's called killing...

A way to approach this would be using the tasklist and taskkill commands. With taskkill you could locate the processes with memory usage greater than x and then use that pid (process id) to do a taskill.

Starting again would mean that you just call the executable again that you've just killed.
0
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 40418378
A common method is to setup Performance Monitoring for those processes, watching for memory consumption, and having a batch with the taskkill and process startup as action.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now