如果超过6GB,则终止进程 [英] kill process if it exceeds 6GB

查看:74
本文介绍了如果超过6GB,则终止进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前在Windows服务器上,某些进程正在运行,并且一直在消耗内存.如果超过特定限制,我想终止该过程.如果超过6 GB的内存使用量,则应终止该进程.我正在寻找可以添加到计划任务中的批处理脚本.有什么帮助吗?提前非常感谢.

Currently on windows server, some process is running and it keeps on consuming memory. I want to kill the process if it exceeds specific limit e.g. process should be killed if it exceeds 6 GB memory usage. I'm looking for batch script which could be added to scheduled task. Any help on this? Thanks a lot in advance.

推荐答案

如果内存使用量超过6Gb

taskkill /F /FI "memusage gt 6144000000" /IM java.exe

如果内存使用量超过6Gb

taskkill /F /FI "memusage gt 6144000000"

PS:手册

这篇关于如果超过6GB,则终止进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆