Fills >8G of RAM opening a small SVG file

Bug #1533058 reported by Mathelier
84
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Liam P. White

Bug Description

I am using Inkscape 0.91 r (Oct 19 2015) on Ubuntu 15.10. When trying to open a small file of ~600kB, inkscape fills more than 8G of RAM (filling out my RAM). After filling 4G of swap, the GUI is killed. You can find enclosed the file causing the problem.
When opening some larger other files (>1Mb), it seems to work fine though.

Tags: performance
Revision history for this message
Mathelier (anthoma) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Inspecting the provided test case:
1) The original SVG document was created with matplotlib:
<!-- Created with matplotlib (http://matplotlib.org/) -->
2) It uses a huge stroke miter limit property all over the file (probably originating from the embedded stylesheet, and copied to the style attribute of individual objects by Inkscape after editing the content:
   stroke-miterlimit:100000

After removing the huge stroke-miterlimit properties from the file (externally edited in vim), the document loads quickly and without excessive memory usage in Inkscape 0.91 on OS X 10.7.5 (see attached modified version of the provided SVG file).

--
[1] The default value for stroke-miterlimit is '4' (AFAICT sufficient for many or most use cases - I rarely had a need to increase it to more than 10 - if at all).
http://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty
AFAIU the value for the stroke-miterlimit can directly affect Inkscape's performance via (visual) bounding box calculations - 100'000 as miter limit seems excessive to me, and I wonder where this value originates from (or why it is set so high for the default stroke style) ...

tags: added: performance
Revision history for this message
su_v (suv-lp) wrote :

On OS X 10.7.5:
- reproduced with Inkscape 0.91 r13725
- not reproduced with Inkscape 0.91+devel r14577

Based on tests with archived builds by Liam P. White (on Ubuntu) and myself (on OS X 10.7.5), this was fixed in trunk in rev 13966, which was backported to the stable release branch (for Inkscape 0.91.1) in rev 13772.

Earlier reports related to rev 13966: bug #1424000, bug #1427689

Changed in inkscape:
assignee: nobody → Liam P. White (inkscapebrony)
importance: Undecided → High
milestone: none → 0.91.1
status: New → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

For further details, see also newer (duplicate) bug #1534376:

On 2016-01-15 24:47 (+0100), Ian Williamson wrote:
> Interestingly, I had not encountered this issue on my SVG's that were
> generated by matplotlib v1.4.3. I've compared a different version of the
> same SVG that was generated by v1.4.3 to the one attached (again,
> generated by v1.5.1) and the only meaningful difference that I can see
> is the addition of
>
> stroke-miterlimit:100000;
>
> on line 8 of the SVG generated by matplotlib v1.5.1.

A change in matplotlib 1.5.1 generates SVG files which unfortunately trigger the described symptoms (due to a bug in the renderer of Inkscape 0.91).

jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.91.1 → 0.92
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.