Atlaslog
Atlaslog / Field Notes / deck.gl visualization
Field note · deck.gl visualization

1.2 million GPS rows crash the tab with an array buffer error

Quick answer

Parsing 1.2 million CSV rows into object arrays costs 400 MB before any rendering, and deck.gl keeps the previous copy for diffing, so the peak approaches 2.4 GB. The page dies inside TripsLayer.initializeState with a Float32Array allocation failure.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: deck.gl
Symptom
Checklist
  1. Log record count and usedJSHeapSize before and after parsing.
  2. Cut to 100k rows to confirm the crash is a scale problem rather than one bad record.
  3. Check whether data is an object array from d3.csv or papaparse instead of typed arrays.
  4. Inspect getPath for per-point temporary array creation.
Fix

Feed binary attributes (Float32Array positions and timestamps) through data: { length, attributes: { getPosition: { value, size: 2 } } }, load by tile or time window on moveend, and pre-build flat path arrays for TripsLayer.

Code
Uncaught RangeError: Array buffer allocation failed
    at new Float32Array (<anonymous>)
    at TripsLayer.initializeState (trips-layer.js:88)
console.log('记录数', data.length);
console.log('堆内存 MB', (performance.memory.usedJSHeapSize / 1048576).toFixed(1));
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). 1.2 million GPS rows crash the tab with an array buffer error. https://www.jingweizhi.com/en/cookbook/deckgl-oom-large-data.html (accessed 2026-11-03).