performance.memory (legacy heap size)
Reads JavaScript heap sizes in Chrome.
In one line
Can see how much memory the page uses, in Chrome and Edge
Reads JavaScript heap sizes in Chrome.
Exposes usedJSHeapSize, totalJSHeapSize and jsHeapSizeLimit, which cluster by device RAM and OS (about 4 GB on 64-bit desktop, 2 GB on mobile). Values are quantized.
What it can and can't do
What the user does: Nothing. It happens when the page asks
It can
- Get used, total and limit sizes for the page's memory
- Guess your device memory, around 4 GB on desktop and 2 GB on phones
- Find memory leaks in its own page
It cannot
- See other tabs or apps
- Get exact values, since they are rounded
- Work in Firefox or Safari
- Ask permission first
How it differs between platforms: Only Chrome and Edge. Firefox and Safari do not support it.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 7 | 2010-10-19 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | performance.memory.jsHeapSizeLimit; totalJSHeapSize; usedJSHeapSize |
| Browser compat keys | api.Performance.memory |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Read performance.memory
Data you get
What comes back: 3 integers (bucketed in non-isolated contexts)
Shape: object
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
jsHeapSizeLimit | integer | bytes | 2147483648 to 4294967296 | bucketed |
usedJSHeapSize | integer | bytes | 1 MB to 4 GB | bucketed to about 10 KB or quantized |
Technical limits
- Chromium only
- Non-standard
The story
What it is
An older Chrome feature that reports the size of JavaScript memory, rounded to blur the exact number.
For you
You never see it. It lets a site learn roughly how much memory your tab uses, and a rounded value hints at how much memory your device has. Newer tools have mostly replaced it.
For makers
Developers used it to catch leaks, but it is not precise and not standard. Some fraud and tracking tools read it as a clue to your device class. Chrome blurs the numbers to limit this.
Where you see it
| Type | Example | Apps |
|---|---|---|
| developer | A developer logs memory use in a test to check that an app does not leak over time. | None named |
| games | A browser game watches heap growth to know when to free textures before the tab crashes. | None named |
| security | A bot detector sees a heap size that is typical of a headless browser. | None named |
| ads | A tracker adds the rounded heap limit to a device ID, since it varies by device memory. | None named |
| productivity | A web office app warns you to save when memory use gets high. | None named |
| analytics | A monitoring script records heap size at each page view to find slow releases. | Datadog RUM |
| video | A video call site checks memory on old laptops to decide on lighter effects. | None named |
Risks
- Chrome only
- Hints at device memory
Good uses and abuse
Legitimate uses
- Developer diagnostics
Known abuse
- Adds RAM class signal
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 2 | Rough identifying entropy, when known |
History
- 2019-01, Chrome: Values quantized and bucketed to limit fingerprinting
Related capabilities
Related
- measureUserAgentSpecificMemory(). Can check how much memory the page and its embeds use
Sources
How well checked: Based on official documentation.