MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / enable_swap_linux

Function enable_swap_linux

bleachbit/Memory.py:97–105  ·  view source on GitHub ↗

Enable Linux swap

()

Source from the content-addressed store, hash-verified

95
96
97def enable_swap_linux():
98 """Enable Linux swap"""
99 logger.debug(_("Re-enabling swap."))
100 args = ["swapon", "-a"]
101 p = subprocess.Popen(args, stderr=subprocess.PIPE)
102 p.wait()
103 outputs = p.communicate()
104 if 0 != p.returncode:
105 raise RuntimeError(outputs[1].replace("\n", ""))
106
107
108def make_self_oom_target_linux():

Callers 2

test_swap_off_swap_onMethod · 0.90
wipe_memoryFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_swap_off_swap_onMethod · 0.72