def METHOD_NAME(self) -> bool:
    if self.app_config.worker.max_memory_pct <= 0:
        return True
    virtual_memory_used = int(virtual_memory().used)
    virtual_memory_total = int(virtual_memory().total)
    percent = (swap_memory().used + virtual_memory_used) / (swap_memory().total + virtual_memory_total)
    ok = percent < self.app_config.worker.max_memory_pct
    if not ok:
        logging.info(
            f"memory usage (RAM + SWAP) is too high: {percent:.0f}% - max is"
            f" {self.app_config.worker.max_memory_pct}%"
        )
    return ok