@@ -5,21 +5,6 @@ export interface MemorySnapshot {
55 byType : Record < string , number > ;
66}
77
8- /**
9- * Summarize per-process memory (from `app.getAppMetrics()`, passed in by the
10- * caller so this stays free of a direct `electron` import) for crash
11- * diagnostics. Working-set sizes are in KB. Attached to renderer/child crash
12- * events so PostHog Error Tracking can show whether the app was under memory
13- * pressure: a hard OOM kills the renderer before it can log anything, so the
14- * chromium log usually goes silent and this is the only reliable signal.
15- *
16- * Defensive on purpose: a throw here would run before the crash handler's
17- * auto-recovery reload, so failures return `undefined` instead.
18- *
19- * Caveat: at `render-process-gone` time the dead renderer is already gone from
20- * the metrics, so the `Tab` total understates the renderer's real peak. The
21- * `unresponsive` sample (renderer still alive) is the more telling one.
22- */
238export function collectMemorySnapshot (
249 getMetrics : ( ) => Electron . ProcessMetric [ ] ,
2510) : MemorySnapshot | undefined {
@@ -48,11 +33,6 @@ export function collectMemorySnapshot(
4833 }
4934}
5035
51- /**
52- * Flatten a snapshot into scalar event properties for PostHog (which doesn't
53- * accept nested objects, so `byType` is serialized). Returns `{}` when no
54- * snapshot was collected, so it spreads cleanly into a crash event's props.
55- */
5636export function flattenMemorySnapshot (
5737 memory : MemorySnapshot | undefined ,
5838) : Record < string , number | string > {
0 commit comments