def __init__(self, allocate, swap_mem_size=None, total_mem_threshold=None, available_mem_threshold=None):
    '\n        Initialize the SWAP memory allocator.\n        The allocator will try to setup SWAP memory only if all the below conditions are met:\n            - allocate evaluates to True\n            - disk has enough space(> DISK_MEM_THRESHOLD)\n            - either system total memory < total_mem_threshold or system available memory < available_mem_threshold\n\n        @param allocate: True to allocate SWAP memory if necessarry\n        @param swap_mem_size: the size of SWAP memory to allocate(in MiB)\n        @param total_mem_threshold: the system totla memory threshold(in MiB)\n        @param available_mem_threshold: the system available memory threshold(in MiB)\n        '
    self.allocate = allocate
    self.swap_mem_size = (SWAPAllocator.SWAP_MEM_SIZE if (swap_mem_size is None) else swap_mem_size)
    self.total_mem_threshold = (SWAPAllocator.TOTAL_MEM_THRESHOLD if (total_mem_threshold is None) else total_mem_threshold)
    self.available_mem_threshold = (SWAPAllocator.AVAILABLE_MEM_THRESHOLD if (available_mem_threshold is None) else available_mem_threshold)
    self.is_allocated = False
Initialize the SWAP memory allocator.
The allocator will try to setup SWAP memory only if all the below conditions are met:
    - allocate evaluates to True
    - disk has enough space(> DISK_MEM_THRESHOLD)
    - either system total memory < total_mem_threshold or system available memory < available_mem_threshold

@param allocate: True to allocate SWAP memory if necessarry
@param swap_mem_size: the size of SWAP memory to allocate(in MiB)
@param total_mem_threshold: the system totla memory threshold(in MiB)
@param available_mem_threshold: the system available memory threshold(in MiB)
def __init__(self, allocate, swap_mem_size=None, total_mem_threshold=None, available_mem_threshold=None):
    '\n        Initialize the SWAP memory allocator.\n        The allocator will try to setup SWAP memory only if all the below conditions are met:\n            - allocate evaluates to True\n            - disk has enough space(> DISK_MEM_THRESHOLD)\n            - either system total memory < total_mem_threshold or system available memory < available_mem_threshold\n\n        @param allocate: True to allocate SWAP memory if necessarry\n        @param swap_mem_size: the size of SWAP memory to allocate(in MiB)\n        @param total_mem_threshold: the system totla memory threshold(in MiB)\n        @param available_mem_threshold: the system available memory threshold(in MiB)\n        '
    self.allocate = allocate
    self.swap_mem_size = (SWAPAllocator.SWAP_MEM_SIZE if (swap_mem_size is None) else swap_mem_size)
    self.total_mem_threshold = (SWAPAllocator.TOTAL_MEM_THRESHOLD if (total_mem_threshold is None) else total_mem_threshold)
    self.available_mem_threshold = (SWAPAllocator.AVAILABLE_MEM_THRESHOLD if (available_mem_threshold is None) else available_mem_threshold)
    self.is_allocated = False