-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Convert large json file to html raises "MemoryError" #372
Comments
I think you can work around this, eg by using generator instead of passing a big templateVars. |
@manhg Thank you very much, it works! |
: ) I'm glad to hear it works. |
Also for future reference: Jinja can iteratively render templates with the stream system. |
I'm using jinja 2.7.3 to convert test log (json file) to html, the template using is pretty simple:
I use a simple script to convert it:
When the log file is large near 30M, the template.render(templateVars) raise "MemoryError", I tried some other log files smaller, such 2-10M, the script runs fine.
My environnement is:
Windows XP
Python 2.7.8
Jinja2 : 2.7.3
The text was updated successfully, but these errors were encountered: