บทความ

กำลังแสดงโพสต์จาก มิถุนายน, 2023

How to Fix “JavaScript Heap Out of Memory Error”

JavaScript heap out of memory problem: Fetching millions of records with MariaDB, Sequelize & Node.js to display in DevExtreme PivotGrid sol:  How to Fix “JavaScript Heap Out of Memory Error” 3.6 million rows. Lets assume each row has  128 bytes  of data, which is  460,800,000 bytes  is  439 mb  of raw data you're trying to select, which doesn't sound too bad. But this data will be wrapped in objects/models/turned to json, so your memory requirement turns out at least roughly ten fold.  4.3GB . Okay, still not too bad. Now we need to push it to browser, style it, wrap it in html, json etc... We're going to push roughly  1.4GB  in json to the client. client downloads happily. The json is in the browser. It's getting turned into an object. Memory times 4 roughly.  5.6GB . Not too shabby, but the browser will have copped out because it has a 256MB memory limit per tab( I've run into this when coding a game, will vary per browser )....