mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6794
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5517
Author: @kolacheee
Created: 8/25/2026
Status: ❌ Closed
Base:
staging← Head:feat/5506-heap-telemetry📝 Commits (2)
562f74efeat(server): heap telemetry for diagnosing memory-pressure unresponsiveness2eaf081fix(heap-monitor): hysteresis, guarded tick, and monotonic clock (review round)📊 Changes
9 files changed (+403 additions, -1 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/TROUBLESHOOTING.md(+8 -0)📝
packages/client/src/components/panels/SettingsPanel.tsx(+13 -1)📝
packages/client/src/lib/support-diagnostics.ts(+17 -0)📝
packages/server/src/app.ts(+4 -0)📝
packages/server/src/index.ts(+3 -0)➕
packages/server/src/services/heap-monitor.ts(+163 -0)➕
scripts/regressions/heap-telemetry.regression.ts(+192 -0)📝
scripts/regressions/open-issues.regression.ts(+2 -0)📄 Description
Linked issue
Related to #5506 (the diagnosis-neutral observability arm; the issue stays open for the adaptive Termux heap-default work).
Why this change
The #5506 investigation found that large profiles are fully heap-resident in the file-backed store, so a server whose live set approaches
--max-old-space-sizedegrades into a permanent full-GC regime long before V8 aborts — and today that state is completely invisible: Support Diagnostics and/api/healthcarry zero memory fields, there is nov8.getHeapStatisticscall anywhere in the tree, and the persistent Termux session logs cannot distinguish "GC storm at the heap ceiling" from "process frozen or killed by Android". Every report in this class arrives undiagnosable.What changed
heap-monitorservice (packages/server/src/services/heap-monitor.ts): logs the active Node heap limit at startup (so every Termux session log records which limit it ran under), and checks pressure once a minute — on crossing 85% of the limit it logs one actionable warning (how to raiseNODE_OPTIONS), reminds at most every 10 minutes while pressure persists, and logs a recovery line on the way down. Never per-minute spam. The interval is unref'd; the pure state machine is freeze-safe (an Android process freeze at worst produces one late reminder)./api/healthnow includesmemory: { heapUsedMB, heapLimitMB, heapUsedPercent, rssMB }(a couple of cheap V8 calls; the payload grows ~70 bytes).Server memory:line, e.g.842 MB / 1024 MB heap (82%), 1210 MB RSS. Old servers without the field showUnavailableinstead of breaking.docs/TROUBLESHOOTING.md: explains the[heap] Memory pressurewarning and the explicit-heap override in the existing "Termux closes or restarts" section.scripts/regressions/heap-telemetry.regression.ts): pins the warn-once/remind/recover state machine, snapshot sanity, the formatter (including old-server and malformed-input fall-throughs), and the wiring inapp.ts/index.ts.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm lint(tsc + eslint, all packages) and the full production build are green locally; the new regression passes.pnpm check'sformat:checkstep fails on this Windows checkout repo-wide (autocrlf CRLF, pre-existing — same as CI-green PRs before this one); the touched package files were run through Prettier directly with zero content changes.rss()throw could reach the process-fataluncaughtExceptionhandler — the telemetry could kill the server it monitors), and wall-clock reminder spacing (a backward NTP step silenced reminders — nowperformance.now()).formatSupportDiagnosticsfixture inopen-issues.regression.tswas updated for the new field, but that lane currently dies at import time on staging (the@/libalias inlocal-notifications.ts, unrelated to this PR, reproduced with zero local changes) — filed as #5516, so the fixture edit is type-checked but not lane-executed; the same formatter line is executed by the new heap-telemetry regression./api/healthis deliberately auth-exempt (it already reports version/commit/OS); the memory numbers ride the same tier — flagged for awareness, consistent with the existing surface./api/healthreturned{"heapUsedMB":76,"heapLimitMB":4288,"heapUsedPercent":2,"rssMB":194}with all pre-existing keys intact, and the startup line[heap] Node heap limit 4288MB (heap 68MB in use, RSS 193MB)was logged. (4288 = V8's default on a desktop; under the Termux launcher this records the configured limit.)Server memory:line.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG entry added under [Unreleased] → Added.
docs/TROUBLESHOOTING.mdchanged — per the batched-docs-i18n convention this should ride the next[docs-i18n]batch rather than a per-PR follow-up; flagging instead of opening a fresh issue.UI evidence (if applicable)
The only UI-visible change is one new line in the Support Diagnostics clipboard text (screenshot-worthy during the manual pass).
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.