Skip to Content
Platform.Ontology

JS heap size

Chromium reports JavaScript heap size limits, which track device RAM.

Gets silentlyDevice detailsHardwareWeb browsersWhen the page loadsWhile you use it

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

BrowserStatusFirst versionReleasedNote
ChromeSupported72010-10-19Non-standard; quantized
EdgeSupported792020-01-15None
FirefoxNot supportedNot availableNot listedNone
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported4.02016-03-11None

How a site asks for it

APIperformance.memory.jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsread fresh on every page load; nothing stored
How to take it backnone needed (no grant)
Inside an iframeReadable from cross-origin iframes too (same values)

Typical flow

  1. Page script reads the value
  2. No prompt is shown

Data you get

Shape: object
How often: static per session

FieldTypeUnitRangePrecision
jsHeapSizeLimitintegerbytesabout 0.5 GB to 4 GBbucketed
usedJSHeapSizeintegerbytes0 to limitbucketed

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

TypeExampleApps
developerA web app team logs heap size in tests to find a leak that slowly eats memory.Sentry
gamesA large browser game checks the heap limit and loads smaller maps on devices with a low limit.None named
creativeA browser design tool warns before opening a huge file that would exceed the tab's memory.Figma
productivityA big spreadsheet in the browser avoids loading everything at once when memory is tight.Google Sheets
securityA bot detector notes that a headless browser reports a typical server heap size and flags it.None named
adsAn 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

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility2 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits1.5Rough identifying entropy, when known

History

  • 2019-01, Chrome: Values bucketed and jittered to reduce precision

Sources

How well checked: Based on official documentation.

On this page