Summary: | MemoryError after many calls to Context.set_font_matrix | ||
---|---|---|---|
Product: | pycairo | Reporter: | Wouter <wmieras> |
Component: | general | Assignee: | Steve Chaplin <d74n5pohf9> |
Status: | RESOLVED NOTOURBUG | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Windows (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
This a an example script which shows the problem
updated test |
Created attachment 38753 [details]
updated test
For the example script I would recommend using xrange (or while) instead of range - to avoid allocating a long list of integers in memory. On Linux (with 2GB ram) the script runs ok to 10,000. But I can see memory use increasing, which may be a problem. I updated the example script to look for a memory leak in Python. On my system the number of objects is constant, and the number of uncollectable objects is constant and zero - so it does not look like a Python or pycairo problem to me. You could try translating the test script into C and see if the memory use still increases. That should tell you whether it is a C or Python problem. Closing as the problem reported has not been demonstrated to be a pycairo bug, and it looks unlikely that there will be any progress on the issue. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 38698 [details] This a an example script which shows the problem While drawing a lot of text-items with different rotations appied to them (a graph with arc-flows displayed) I encountered a MemoryError. I've managed to isolate the problem to a lot of calls to Context.set_font_matrix, which crashes on my computer after ~5000 calls (see the included attachment). A workaround for me was to reduce the amount of calls to set_font_matrix - this can be done by only allowing a limited amount of angles and drawing all text-items for one specific angle at once. I'm curious whether the problem is a pyCairo problem, a Cairo problem, a Windows problem or just bad programming from me :-) Regards, Wouter