Solved

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

Posted on 2014-11-02
2
346 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, EE MVE
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 69

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

809 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