MCPcopy Create free account
hub / github.com/1jehuang/jcode / sum_tree_pss

Function sum_tree_pss

scripts/bench_memory_cli.py:320–330  ·  view source on GitHub ↗
(root_pids: list[int], pgids: list[int])

Source from the content-addressed store, hash-verified

318
319
320def sum_tree_pss(root_pids: list[int], pgids: list[int]) -> tuple[float, int]:
321 all_pids = collect_descendants(root_pids) | collect_process_group_pids(pgids)
322 total = 0.0
323 counted = 0
324 for pid in sorted(all_pids):
325 pss = read_pss_mb(pid)
326 if pss is None:
327 continue
328 total += pss
329 counted += 1
330 return round(total, 1), counted
331
332
333def terminate_pgroup(pgid: int) -> None:

Callers 1

run_toolFunction · 0.85

Calls 3

collect_descendantsFunction · 0.85
read_pss_mbFunction · 0.85

Tested by

no test coverage detected