File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -460,8 +460,10 @@ def __enter__(self):
460
460
meminfo = self .read_from_meminfo ()
461
461
mem_total_in_bytes = meminfo ["MemTotal" ] * SWAPAllocator .KiB_TO_BYTES_FACTOR
462
462
mem_avail_in_bytes = meminfo ["MemAvailable" ] * SWAPAllocator .KiB_TO_BYTES_FACTOR
463
- if (mem_total_in_bytes < self .total_mem_threshold * SWAPAllocator .MiB_TO_BYTES_FACTOR
464
- or mem_avail_in_bytes < self .available_mem_threshold * SWAPAllocator .MiB_TO_BYTES_FACTOR ):
463
+ swap_total_in_bytes = meminfo ["SwapTotal" ] * SWAPAllocator .KiB_TO_BYTES_FACTOR
464
+ swap_free_in_bytes = meminfo ["SwapFree" ] * SWAPAllocator .KiB_TO_BYTES_FACTOR
465
+ if (mem_total_in_bytes + swap_total_in_bytes < self .total_mem_threshold * SWAPAllocator .MiB_TO_BYTES_FACTOR
466
+ or mem_avail_in_bytes + swap_free_in_bytes < self .available_mem_threshold * SWAPAllocator .MiB_TO_BYTES_FACTOR ):
465
467
echo_and_log ("Setup SWAP memory" )
466
468
swapfile = SWAPAllocator .SWAP_FILE_PATH
467
469
if os .path .exists (swapfile ):
You can’t perform that action at this time.
0 commit comments