MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _detect_ram_from_proc

Method _detect_ram_from_proc

server_capabilities.py:166–179  ·  view source on GitHub ↗

Fallback RAM detection from /proc/meminfo

(self)

Source from the content-addressed store, hash-verified

164
165 except Exception as e:
166 logger.error(f"Error detecting capabilities: {e}")
167
168 return self.capabilities
169
170 def _detect_hardware(self):
171 """Detect CPU and memory specifications"""
172 # Architecture
173 arch = platform.machine().lower()
174 self.capabilities.architecture = arch
175 self.capabilities.is_64bit = platform.architecture()[0] == '64bit'
176
177 # CPU cores
178 try:
179 self.capabilities.cpu_cores = os.cpu_count() or 1
180 except Exception:
181 self.capabilities.cpu_cores = 1
182

Callers 1

_detect_hardwareMethod · 0.95

Calls 1

warningMethod · 0.80

Tested by

no test coverage detected