You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to debug. So not sure if this is a bug, or maybe ideas to fix. I have a basic app, and parser setup, loading a 300MB xml file.
Getting the following error I believe from inside the parser somewhere:
FATAL ERROR: JS Allocation failed - process out of memory
Just curious if you've tested anything large, before I dig into my code/parsing, although I'm not hitting even the first open tag before memory exhausts. I can post a working gist, but essentially this is what's going on :
var fs = require('fs');
var parser = sax.parser();
var fileStream = fs.createReadStream(process.argv[2],
{'bufferSize': 4 * 1024}
);
var xml = '';
fileStream.addListener("data",function(chunk){
xml += chunk;
});
fileStream.addListener("close", function(){
console.log("file read into xml");
parser.write(xml).close();
});
tnks
The text was updated successfully, but these errors were encountered:
okay, i plowed away and saw the prettyprint example, i noticed i wasn't passing the encoding of utf8 into the filestream, and with that the parser error above goes away (as does the memory issue if i write in chunks, not the entire buf).
Trying to debug. So not sure if this is a bug, or maybe ideas to fix. I have a basic app, and parser setup, loading a 300MB xml file.
Getting the following error I believe from inside the parser somewhere:
FATAL ERROR: JS Allocation failed - process out of memory
Just curious if you've tested anything large, before I dig into my code/parsing, although I'm not hitting even the first open tag before memory exhausts. I can post a working gist, but essentially this is what's going on :
var fs = require('fs');
var parser = sax.parser();
var fileStream = fs.createReadStream(process.argv[2],
{'bufferSize': 4 * 1024}
);
var xml = '';
fileStream.addListener("data",function(chunk){
xml += chunk;
});
fileStream.addListener("close", function(){
console.log("file read into xml");
parser.write(xml).close();
});
tnks
The text was updated successfully, but these errors were encountered: