-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pandoc runs out of memory, unless trace logging is enabled #8762
Comments
That's quite interesting, and it seems to point to some kind of laziness-related issue (tracing probably forces evaluation of thunks that otherwise accumulate). |
Sure, we will put together a minimal example that demonstrates the issue. In the meantime, for the same input, we ran into a related issue, where the |
Please find below an example that demonstrates the issue. The markdown source (with embedded, base64-encoded images), the HTML template, and the command to call pandoc are included. If you run the command as included, the memory usage will be high. However, if you add Please ignore the additional issue with the post-processing step I mentioned in my previous comment. We improved that command, which helped reduce the memory usage. |
My test, without
With
Big difference in memory in use! |
Yes, our observations were very similar to yours. |
Thank you for fixing this issue! Just wanted to confirm that after upgrading to Pandoc 3.1.5 and removing the |
Fantastic! |
Hello,
We are relying on pandoc for converting markdown to HTML. We ran into an out of memory issue, similar to the ones that had been reported several times before, and found that enabling trace logging helps avoid the problem (as mentioned in e.g. #3169).
The input markdown was ~18MB (with inlined images) and the conversion was failing, because pandoc reached the available memory and the OS (Ubuntu 20.04) killed the process. We tried increasing the assigned memory to over 3GB and the conversion completed fine.
We also ran the same conversion with
--trace
and it completed fine, requiring only 100-200MB memory. So about 15-20 times less than without trace logging.Now we are forced to always run pandoc with the
--trace
flag to avoid excessive memory usage and the process being killed.As a side note, while investigating this issue, we initially used pandoc 2.16.2, then upgraded to 2.19.2 and finally we tried 3.1.2. 3.1.2 did help reduce the default memory usage (without trace), but only marginally.
It would be good to fix the default memory usage of the application, so that we don't need to rely on trace logging for it to work for slightly large inputs.
Thank you!
The text was updated successfully, but these errors were encountered: