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
We've discovered that we have a high memory usage in one of our services, and after investigating, it seems that the latest version of weasyprint 63 consumes more memory than expected.
The example below consumes over 2GB using weasyprint 63.
Using version 62.3 it is stable at ~60MB.
Python 3.13.0
Thanks a lot !
python
import gc
import psutil
from weasyprint import HTML
iterations = 10000
for i in range(iterations):
pdf = HTML(string="<html>Hello world</html>").write_pdf(
'/tmp/example.pdf', stylesheets=[],
font_config=None)
progress = (i + 1) / iterations * 100
process = psutil.Process()
memory_info = process.memory_info()
print(
f"Progress: {progress:.2f}% | "
f"Current Memory Usage: {memory_info.rss / (1024 * 1024):.2f} MB"
)
if i % 200 == 0:
#gc.collect()
pass
The text was updated successfully, but these errors were encountered:
Hello 👋,
We've discovered that we have a high memory usage in one of our services, and after investigating, it seems that the latest version of weasyprint 63 consumes more memory than expected.
The example below consumes over 2GB using weasyprint 63.
Using version 62.3 it is stable at ~60MB.
Python 3.13.0
Thanks a lot !
The text was updated successfully, but these errors were encountered: