fix(ipc): report actual consumed memory instead of RSS - #2235
fix(ipc): report actual consumed memory instead of RSS#2235rosetta-livekit-bot[bot] wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: fdbf9dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 39 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| const MEMORY_WARN_RESET_DELTA_MB = 50; | ||
| const execFileAsync = promisify(execFile); | ||
|
|
||
| type MemoryMetric = 'pss' | 'uss' | 'footprint' | 'rss' | 'unknown'; |
There was a problem hiding this comment.
🟡 New memory-reading helper added without documentation comments
The newly added memory-reading helper is introduced (getPssMB at agents/src/ipc/supervised_proc.ts:319) without any documentation comment, while the repository requires every new method to be documented.
Impact: Contributors and generated API docs lack an explanation of what the new memory number means and when it is unavailable.
Repository rule requiring documentation of new methods
CONTRIBUTING.md states: "If writing new methods/interfaces/enums/classes, document them. This project uses TypeDoc for automatic API documentation generation, and every new addition has to be properly documented." The new getPssMB method (agents/src/ipc/supervised_proc.ts:319-333) and the new MemoryMetric type alias (agents/src/ipc/supervised_proc.ts:16) have no doc comments, unlike the documented ProcOpts fields directly above them.
Was this helpful? React with 👍 or 👎 to provide feedback.
Ports livekit/agents#6082 to the Node.js IPC supervisor.
Summary
pssorrssmetric in diagnostic logs@livekit/agentsThe final target diff is 84 changed lines, smaller than the source PRs 115 changed lines.
Source diff coverage
Source diff coverage
livekit-agents/livekit/agents/ipc/supervised_proc.py: adapted toagents/src/ipc/supervised_proc.ts. The target has no psutil counterpart, so Linux PSS is read asynchronously fromsmaps_rollupor aggregatedsmaps; the existing pidusage RSS sampler remains the fallback. No macOS or Windows special casing is added, matching the source PR caveat that supervised children do not expose USS there without elevated privileges.tests/test_supervised_proc_memory.py: adapted toagents/src/ipc/supervised_proc.test.ts. Ports metric logging, Linux PSS selection, and RSS fallback coverage. The own-process macOS/Windows USS probe is not applicable to the target supervised-child behavior described by the source PR and is intentionally omitted.Verification
pnpm test agents --silent(1,587 passed, 5 skipped)pnpm build(40 packages)pnpm lint(passes with existing warnings)pnpm format:checkSource: livekit/agents#6082