Huge memory usage on toBuffer
See original GitHub issueI’m working on dynamically generated documents. There is a lot of images created in some promises, and in many cases toBuffer method consumes way too big amount of memory. Is there any way to use streams in my case? In many scenarios total memory usage (when toBuffer is initialised) exceeds 8gb code example:
await Promise.all(promises).then(data => data.forEach(item => section.children.push(...item)));
// report-generator | Total Memory used: 1397.78 MB
doc.addSection(section);
// report-generator | Total Memory used 4: 1523.53 MB
let buffer = await docx.Packer.toBuffer(doc);
// report-generator | Total Memory used 5: 2590.27 MB
as I know in the history there was an option of creating a stream using Packer.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
NodeJS Sharp Node Package Memory Consumption Issue
The problem is Node process keeps adding the processed file in memory and never releases it. As a result, amount of memory consumed...
Read more >Memory runs full over time, high "buffer/cache" usage, low ...
Whenever I reboot my laptop, everything runs amazingly and I have a maximum of 40% memory usage (out of 8GB). However over time...
Read more >Potential buffer overflow and high memory usage in IBM HTTP ...
This APAR resolves a problem with SetEnvIf usage potentially leading to buffer overflow or high memory usage in IBM HTTP.
Read more >virtual machines - RAM usage is high altough there is no high ...
Our virtual server has Centos 6 OS. When I look to buffer/cache usage it seems less at first line. Proccesses're not use to...
Read more >Why the Buffer and Cache Occupy Too Much Memory ... - 华为云
When querying the system memory usage using free after the Linux ECS ... a high cache memory usage does not affect the system...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Probably could work, if you could make a PR with it, that could be nice
It might complicate the API which is my concern, now having two ways of achieving something
I gave up… And with my friend we’ve wrote C++ app to combine multiple docx files So i create a lot of small files nad in. the end I merge them into one. I was able to do so bcs Im generating everything on cloud server as side process