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
Got a Heap out of memory error,
I am appending 1,000,000 file streams to the archive.append(file_stream, { name: file_name }) one by one in a loop
seems like the archiver keeps the reference of all streams in heap memory finally throwing the Heap out of memory error.
// After archiver initialization and pipe to the output stream
...
...
for (const file of files) {
const result = await S3Service.createLazyDownloadStream(file);
if (result.fileResponse) {
try {
archive.append(result.stream, {name: getKeyPath(result)});
} catch (error) {
Logger.logInfo('Error appending to archive:'+ error);
}
}
}
await archive.finalize();
...
...
The text was updated successfully, but these errors were encountered:
Got a Heap out of memory error,
I am appending 1,000,000 file streams to the archive.append(file_stream, { name: file_name }) one by one in a loop
seems like the archiver keeps the reference of all streams in heap memory finally throwing the Heap out of memory error.
The text was updated successfully, but these errors were encountered: