Jump to content

Automatically Restart a Process

Go to solution Solved by xAcid9,
28 minutes ago, Hi P said:

the problem is that process either goes up little by little (I've seen it happen), in which case your method would work a 100%

 

But there are cases when it suddenly goes up, in the span of 5 seconds, from 30 mb to as much RAM as your system has, in which case your method wouldn't stop it from happening :(

 

I Google and mashed up this script.

@echo off
setlocal enabledelayedexpansion
:start
set _mem=0
for /f "skip=3 usebackq tokens=5" %%i in (`tasklist /fi "<process name>"`) do (
  set /a _mem += %%i
  )
echo Total Memory = !_mem! K

if !_mem! GTR <memory in KB> taskkill /im <process name.exe> /f
endlocal

save as bat file and use Task Scheduler to run it maybe every 60 secs. ?

use Task Scheduler hidden option if you don't want to see it popup every minute.

This is pretty much a follow up on my other post:

 

The problem didn't go away.

 

Do you guys know of any free program to automatically kill / reset a process if it's taking x amount of memory?

 

I found "Process Lasso" but the Watchdog function is trial period only.

 

Edit:

For the curious, it seems to be an on-going Wacom bug for the past 2 years according to this post

http://forum.wacom.eu/viewtopic.php?f=11&amp;t=1897&amp;start=10

 

 

Link to comment
https://linustechtips.com/topic/1085291-automatically-restart-a-process/
Share on other sites

Link to post
Share on other sites

1 hour ago, Hi P said:

Do you guys know of any free program to automatically kill / reset a process if it's taking x amount of memory?

Maybe you can just create a task scheduler to kill the process every X minutes.

| Intel i7-3770@4.2Ghz | Asus Z77-V | Zotac 980 Ti Amp! Omega | DDR3 1800mhz 4GB x4 | 300GB Intel DC S3500 SSD | 512GB Plextor M5 Pro | 2x 1TB WD Blue HDD |
 | Enermax NAXN82+ 650W 80Plus Bronze | Fiio E07K | Grado SR80i | Cooler Master XB HAF EVO | Logitech G27 | Logitech G600 | CM Storm Quickfire TK | DualShock 4 |

Link to post
Share on other sites

18 minutes ago, xAcid9 said:

Maybe you can just create a task scheduler to kill the process every X minutes.

the problem is that process either goes up little by little (I've seen it happen), in which case your method would work a 100%

 

But there are cases when it suddenly goes up, in the span of 5 seconds, from 30 mb to as much RAM as your system has, in which case your method wouldn't stop it from happening :(

 

Link to post
Share on other sites

28 minutes ago, Hi P said:

the problem is that process either goes up little by little (I've seen it happen), in which case your method would work a 100%

 

But there are cases when it suddenly goes up, in the span of 5 seconds, from 30 mb to as much RAM as your system has, in which case your method wouldn't stop it from happening :(

 

I Google and mashed up this script.

@echo off
setlocal enabledelayedexpansion
:start
set _mem=0
for /f "skip=3 usebackq tokens=5" %%i in (`tasklist /fi "<process name>"`) do (
  set /a _mem += %%i
  )
echo Total Memory = !_mem! K

if !_mem! GTR <memory in KB> taskkill /im <process name.exe> /f
endlocal

save as bat file and use Task Scheduler to run it maybe every 60 secs. ?

use Task Scheduler hidden option if you don't want to see it popup every minute.

| Intel i7-3770@4.2Ghz | Asus Z77-V | Zotac 980 Ti Amp! Omega | DDR3 1800mhz 4GB x4 | 300GB Intel DC S3500 SSD | 512GB Plextor M5 Pro | 2x 1TB WD Blue HDD |
 | Enermax NAXN82+ 650W 80Plus Bronze | Fiio E07K | Grado SR80i | Cooler Master XB HAF EVO | Logitech G27 | Logitech G600 | CM Storm Quickfire TK | DualShock 4 |

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×