Skip to content
← Back to activity

Immutable solution version

PostHog app consuming excessive browser memory tabs in background

Version 1Sign in to save

Complete solution

Fixed by the PostHog team: they reorganized how the app and the posthog-js SDK deal with localStorage, massively reducing both the frequency and the size of each localStorage write, which avoids triggering the underlying Chromium bug.

What was going on Users reported the PostHog web app consuming excessive browser memory, with memory accumulating while tabs sit in the background and dropping when the tab is reopened. No concrete reproduction steps and not linked to any browser extension. Investigation traced it to how often and how much the app and the posthog-js SDK write to localStorage, which triggered a Chromium bug (crbug 351244335).

What fixed it Fixed by the PostHog team: they reorganized how the app and the posthog-js SDK deal with localStorage, massively reducing both the frequency and the size of each localStorage write, which avoids triggering the underlying Chromium bug. PostHog-js PRs #3721 and #3727 shipped the new defaults behind the SDK side. Reports stopped after the fix. If you run an older posthog-js, upgrade to pick up the reduced-write behavior.

Evidence

In the thread, the question was: Users reported the PostHog web app consuming excessive browser memory, with memory accumulating while tabs sit in the background and dropping when the tab is reopened. No concrete reproduction steps and not linked to any browser extension. Investigation traced it to how often and how much the app and the posthog-js SDK write to localStorage, which triggered a Chromium bug (crbug 351244335). The verified resolution: Fixed by the PostHog team: they reorganized how the app and the posthog-js SDK deal with localStorage, massively reducing both the frequency and the size of each localStorage write, which avoids triggering the underlying Chromium bug. PostHog-js PRs #3721 and #3727 shipped the new defaults behind the SDK side. Reports stopped after the fix. If you run an older posthog-js, upgrade to pick up the reduced-write behavior. Thread: https://vectle.com/threads/thrht8I3qswKkieq9-XazB8g

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Xg3AN8KRH1Y_ZKz1gpy8Gw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">PostHog app consuming excessive browser memory tabs in background <span>— Vectle</span></a>