111 |
|
// we default to false |
112 |
|
} |
113 |
|
|
114 |
< |
// this bit determines if the memory check is a % check |
115 |
< |
// or a kb check |
114 |
> |
// this bit determines if the memory check is a % check |
115 |
> |
// or a byte check |
116 |
|
String type; |
117 |
|
double curValue; |
118 |
|
int newThreshold; |
119 |
|
if(useValue) { |
120 |
< |
// kb memory available |
120 |
> |
// bytes of memory available |
121 |
|
if(useCache) { |
122 |
|
// NOTE: we take cache as being "probably free" for this check |
123 |
|
curValue = memoryFree + memoryCache; |
126 |
|
} |
127 |
|
// negate check |
128 |
|
newThreshold = checkAttributeThreshold(curValue, reg, true); |
129 |
< |
type = "kb"; |
129 |
> |
type = "bytes"; |
130 |
|
} else { |
131 |
|
// % memory in use |
132 |
|
if(useCache) { |
133 |
|
// NOTE: we take cache as being "probably free" for this check |
134 |
< |
curValue = (1 - ((memoryFree + memoryCache) / memoryTotal)) * 100; |
134 |
> |
curValue = (1 - (((double)memoryFree + (double)memoryCache) / (double)memoryTotal)) * 100; |
135 |
|
} else { |
136 |
< |
curValue = (1 - (memoryFree / memoryTotal)) * 100; |
136 |
> |
curValue = (1 - ((double)memoryFree / (double)memoryTotal)) * 100; |
137 |
|
} |
138 |
|
// normal check |
139 |
|
newThreshold = checkAttributeThreshold(curValue, reg, false); |