- Notifications
You must be signed in to change notification settings - Fork 328
Description
On September 29th of 2022, I introduced some checks in the unit tests suite to ensure memory usage does not increase:
7fce723. Thoses checks use memunit, that itself uses memory_profiler, which then uses psutil to get the processus current memory usage.
Those were the initial memory caps:
- https://github.com/PyFPDF/fpdf2/blob/master/test/test_perfs.py: in
test_intense_image_rendering(), 165MB - https://github.com/PyFPDF/fpdf2/blob/master/test/image/test_oversized.py: 122MB
- https://github.com/PyFPDF/fpdf2/blob/master/test/image/test_load_image.py: 125MB in
test_share_images_cache()
2 months later, we had to progresively increase those thresholds, as we kept exceeding them during the tests execution in GitHub Actions CI pipelines.
Those are the actual values at the time I'm writing this:
- https://github.com/PyFPDF/fpdf2/blob/master/test/test_perfs.py: in
test_intense_image_rendering(), 178MB - https://github.com/PyFPDF/fpdf2/blob/master/test/image/test_oversized.py: 136MB
- https://github.com/PyFPDF/fpdf2/blob/master/test/image/test_load_image.py: 140MB in
test_share_images_cache()
Those thresholds have all 3 increased by more than 10MB, with 40 extra unit tests added inbetween those commits.
While I expect some variance in GitHub Actions executions, as we have no control over the execution context (the runners capabilities can change, and the load on GitHub systems can vary), I worry that this could point to some memory leak in fpdf2.
I'm opening this isue to keep track of this subject,
and I'd be very happy to get some help from the fpdf2 users community about this 😊