Skip to content

Commit adf9107

Browse files
committed
Merge remote-tracking branch 'origin/prevent-memory-crashes' into cf-600
2 parents 77d4028 + eeac1c0 commit adf9107

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

codeflash/verification/pytest_plugin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ class UnexpectedError(Exception):
3939
import platform
4040
if platform.system() == 'Linux' or platform.system() == 'Darwin':
4141
import resource
42-
import psutil
42+
import os
4343

4444
# Get total system memory
45-
total_memory = psutil.virtual_memory().total
46-
# Set memory limit to 80% of total system memory
45+
total_memory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') # Set memory limit to 80% of total system memory
4746
memory_limit = int(total_memory * 0.8)
4847

4948
# Set both soft and hard limits

0 commit comments

Comments
 (0)