JS heap size
Chromium reports JavaScript heap size limits, which track device RAM.
In one line
Can see how much memory the page can use, which hints at your RAM class
Chromium reports JavaScript heap size limits, which track device RAM.
jsHeapSizeLimit is about 2 to 4 GB on 64-bit desktops and 0.5 to 1 GB on low-end phones, bucketed in Chrome, so it hints at RAM class even though deviceMemory is capped at 8.
What it can and can't do
What the user does: Nothing. It happens when the page runs in Chrome or Edge
It can
- Check the JavaScript memory limit and how much is used
- Guess a low, mid, or high RAM device from the limit
- Tune how much the page loads at once
- Use it as a hardware clue
It cannot
- Work in Firefox, Safari, or on iPhone
- See your exact RAM size
- See memory used by other tabs or apps
- See precise numbers; Chrome rounds them into buckets
How it differs between platforms: Only Chromium browsers share it. Firefox and Safari do not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 7 | 2010-10-19 | Non-standard; quantized |
| 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 | 4.0 | 2016-03-11 | None |
How a site asks for it
| API | performance.memory.jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
jsHeapSizeLimit | integer | bytes | about 0.5 GB to 4 GB | bucketed |
usedJSHeapSize | integer | bytes | 0 to limit | bucketed |
Technical limits
- Non-standard
- Coarsened
The story
What it is
Chrome tells a page how much working memory its JavaScript is allowed to use, which hints at your device's RAM.
For you
You never see it. It is one of the numbers a page can read that quietly shows whether you have a small or large machine, even when other memory numbers are hidden.
For makers
Developers use it to find memory leaks and to learn when a tab is close to crashing. Fingerprinting code uses the same limit to guess RAM class. Chrome rounds the numbers, so the hint is rough.
Where you see it
| Type | Example | Apps |
|---|---|---|
| developer | A web app team logs heap size in tests to find a leak that slowly eats memory. | Sentry |
| games | A large browser game checks the heap limit and loads smaller maps on devices with a low limit. | None named |
| creative | A browser design tool warns before opening a huge file that would exceed the tab's memory. | Figma |
| productivity | A big spreadsheet in the browser avoids loading everything at once when memory is tight. | Google Sheets |
| security | A bot detector notes that a headless browser reports a typical server heap size and flags it. | None named |
| ads | An ad tech script uses heap size to guess a device tier for choosing heavier or lighter ads. | None named |
Risks
- Hint at RAM size
- Chrome only
Good uses and abuse
Legitimate uses
- Memory leak diagnostics
Known abuse
- RAM class fingerprint
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1.5 | Rough identifying entropy, when known |
History
- 2019-01, Chrome: Values bucketed and jittered to reduce precision
Sources
How well checked: Based on official documentation.