We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents de0fa75 + b6bd030 commit 5d64021Copy full SHA for 5d64021
codeflash/verification/pytest_plugin.py
@@ -36,6 +36,20 @@ class UnexpectedError(Exception):
36
pass
37
38
39
+import platform
40
+if platform.system() == 'Linux' or platform.system() == 'Darwin':
41
+ import resource
42
+ import psutil
43
+
44
+ # Get total system memory
45
+ total_memory = psutil.virtual_memory().total
46
+ # Set memory limit to 80% of total system memory
47
+ memory_limit = int(total_memory * 0.8)
48
49
+ # Set both soft and hard limits
50
+ resource.setrlimit(resource.RLIMIT_AS, (memory_limit, memory_limit))
51
52
53
def pytest_addoption(parser: Parser) -> None:
54
"""Add command line options."""
55
pytest_loops = parser.getgroup("loops")
0 commit comments