I'm trying to read a more than one large txt file to read them line by line form s3 , with this code .
const params = {
Bucket: bucket,
Key: key,
};
const s3ReadStream = s3.getObject(params).createReadStream();
const rl = readline.createInterface({
input: s3ReadStream,
terminal: false
});
let myReadPromise = new Promise( (resolve, reject) => {
let line_number = 1;
rl.on('line', async (line) => {
// some code
});
but i have this issue :
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
i increased the memory to 8 GB using this command :
set NODE_OPTIONS="--max-old-space-size=8192"
still getting same issue , any idea how to read these files as chunks !