提交 6a395cbf 编写于 作者: M mindless

[FIXED HUDSON-4284] avoid division by zero for zero swap space


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21029 71c3de6d-444a-0410-be80-ed276b4c234a
上级 2a26a0ef
......@@ -54,7 +54,7 @@ public class SwapSpaceMonitor extends NodeMonitor {
long free = usage.availableSwapSpace;
free/=1024L; // convert to KB
free/=1024L; // convert to MB
if(free>256 || usage.totalSwapSpace/usage.availableSwapSpace<5)
if(free>256 || usage.totalSwapSpace<usage.availableSwapSpace*5)
return free+"MB"; // if we have more than 256MB free or less than 80% filled up, it's OK
// Otherwise considered dangerously low.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册