Windows OS
--
Questions
--
Followers
Top Experts
Is there any quick or easy way of doing it??
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
I guess you could use ProcDump to generate a dump, then use a loop or watcher function batch file to see when ProcDump exits and then kill dllhost based on its exiting, but I don't think that is a long term solution.
the process i need to watch is dllhost
i need to kill it when memory usage is over 1,5 GB or either 80% of full memory available
i know there can be several dllhost process runing at the same time with different pid values, so i don't know how to handle this. i dont want a debug as this server will be shut down in a few weeks time...
C:\>procdump dllhost ???






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
http://www.anvir.com/
There's a free version and pro version.
*edit: Â It might not support 2K3, but it supports XP so I'd give it a shot anyway, since the server seems like it's going bye-bye soon.
@echo off
for /f "tokens=2 delims==" %%a in ('"wmic path Win32_PerfFormattedData_PerfProc_Process Where Name='dllhost.exe' get PercentProcessorTime /value 2>NUL | find /i "PercentProcessorTime""') do set usage=%%a
if %usage% GEQ 80 (
taskkill /im dllhost
) else (
echo Not yet...
)
Based on http://superuser.com/questions/619809/i-need-a-batch-file-that-will-be-able-to-restart-an-exe-when-the-exe-only-uses-1
So what should i do with this piece of code?? How often will this be executed? Im a little puzzled.
Will this write in the else any kind of log, if not whats the point of echoing?
@echo off
for /f "tokens=2 delims==" %%a in ('"wmic path Win32_PerfFormattedData_Pe
if %usage% GEQ 80 (
  taskkill /im dllhost
) else (
  echo "usage at %usage% at %time%"
)

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Without knowing what exactly is running away with memory and CPU, it's hard to guess what advice to give. Â If it's the antivirus software on the server, you could disable this as you state it will only be around a few more weeks. Â Or if the server only used during normal business hours (8 to 5), you could use the task scheduler and have it restart every night to clear out the memory.
Personally, I had a server running Windows Server 2003 that was 8 years old. Â After a few weeks, the memory available would drop to zero due to SQL hogging it all. Â I would just periodically reboot it after hours. Â We replaced that server about a year ago.
Windows OS
--
Questions
--
Followers
Top Experts
This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.