Memory Leak in Cairo?! #16
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: mhu/gds-render#16
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rendering multiple times using the cairo output renderer results in a limitless increasing memory consumption.
The leak seems to be burried inside Cairo's cairo_paint_with_alpha() function. Example Valgrind output:
==5437== 92,738,440 (3,456 direct, 92,734,984 indirect) bytes in 9 blocks are definitely lost in loss record 6,396 of 6,399 ==5437== at 0x483877F: malloc (vg_replace_malloc.c:299) ==5437== by 0x52E5AAA: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52C16EB: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52D19FE: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52EA576: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52EA576: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x529EFFB: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x529938F: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52F7204: cairo_paint_with_alpha (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x116EA2: cairo_render_cell_to_vector_file (cairo-output.c:281) ==5437== by 0x110280: command_line_convert_gds (command-line.c:170) ==5437== by 0x10FCF7: main (main.c:314)
...
LEAK SUMMARY: ==5437== definitely lost: 108,553 bytes in 29 blocks ==5437== indirectly lost: 253,092,816 bytes in 255,198 blocks ==5437== possibly lost: 48,792 bytes in 52 blocks ==5437== still reachable: 65,695 bytes in 105 blocks ==5437== of which reachable via heuristic: ==5437== length64 : 4,832 bytes in 80 blocks ==5437== newarray : 2,080 bytes in 50 blocks ==5437== suppressed: 1,357,951 bytes in 15,968 blocks
Rerun valgrind's memchecker with debug build of cairo:
Remove wontfix tag. But still no real solution is in sight. However, a workaround has been implemented.