File tree 1 file changed +6
-2
lines changed
server/src/main/java/org/elasticsearch/monitor/os
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,9 @@ public ByteSizeValue getUsed() {
220
220
//
221
221
// We intentionally check for (total == 0) rather than (total - free < 0) so as not to hide
222
222
// cases where (free > total) which would be a different bug.
223
- logger .warn ("cannot compute used swap when total swap is 0 and free swap is " + free );
223
+ if (free > 0 ) {
224
+ logger .warn ("cannot compute used swap when total swap is 0 and free swap is " + free );
225
+ }
224
226
return new ByteSizeValue (0 );
225
227
}
226
228
return new ByteSizeValue (total - free );
@@ -280,7 +282,9 @@ public ByteSizeValue getUsed() {
280
282
//
281
283
// We intentionally check for (total == 0) rather than (total - free < 0) so as not to hide
282
284
// cases where (free > total) which would be a different bug.
283
- logger .warn ("cannot compute used memory when total memory is 0 and free memory is " + free );
285
+ if (free > 0 ) {
286
+ logger .warn ("cannot compute used memory when total memory is 0 and free memory is " + free );
287
+ }
284
288
return new ByteSizeValue (0 );
285
289
}
286
290
return new ByteSizeValue (total - free );
You can’t perform that action at this time.
0 commit comments