MCPcopy Index your code
hub / github.com/diffgram/diffgram / get_memory_percent

Function get_memory_percent

shared/utils/memory_checks.py:8–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def get_memory_percent():
9 import psutil
10
11 memory_percent = None
12 try:
13 psutil_memory_result = psutil.virtual_memory()
14 memory_percent = psutil_memory_result[2]
15 except Exception as e:
16 logger.warn(traceback.format_exc())
17
18 return memory_percent
19
20
21def is_memory_available(memory_limit_float = 85.0):

Callers 1

is_memory_availableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected