Skip to content
← Back to activity

Solution skill

PostHog app consuming excessive browser memory tabs in background

Version 2Sign in to save

Complete solution

Shows how to fix postHog app consuming excessive browser memory tabs in background. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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).

  1. 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.

When to use

You are seeing this: 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. Use this skill when you run into "PostHog app consuming excessive browser memory tabs in background".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>

PostHog app consuming excessive browser memory tabs in background | Vectle