Multi-Gigabyte memory leak working with gradients

Bug #1711848 reported by Kver
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

Inkscape 0.91 r13725
(has been present in other versions)

##System Info:

OS: KDE Neon 5.10 (Ubuntu 16.04 base), Linux kernel 4.4.0-91-generic
16B RAM
Nvidia 1080 prop. Drivers

(This bug has been present on several other systems)

##Description:

Dragging a gradient in complex files will cause an observable memory leak. With a system monitor to the side you can watch the memory usage climb in real-time while moving a gradient handle. When dragging a gradient handle to reposition the gradient it can "cost" several megabytes while moving. Moving a single gradient for several seconds can leak hundreds of megabytes.

As the leak progresses editing gradients becomes less responsive and increasingly laggy. The tool is smooth initially but at ~4GB of memory usage it begins to impair functionality. At ~6GB the tool is nearly unusable. I have reached 9GB of leaked memory at worst.

I haven't seen this bug crash Inskcape directly, but it has brought my system to a crawl in general, and of course, it makes Inkscape unusable.

This does not seem to affect other tools. 'The Create and Edit Gradients' tool can be unusable, but the 'Edit Paths by Nodes' tool will remain responsive even with Gigabytes leaked.

##Reproduction:

This bug presents itself at its worst when preparing complex wallpapers for the Plasma desktop, they can can be used as sample files to reproduce the issue:

 - Download and open the linked sample file
 - Open a memory monitor of some kind
 - Using the "create and edit gradients" tool begin moving the gradients to one of the shapes
 - Memory usage will climb, the tool will become less responsive.
 - Closing Inkscape and re-opening the file will return the memory

##Sample file:
https://dl.opendesktop.org/api/files/download/id/1503162653/cascade-source.svg

##Secondary Effect:

A secondary effect which I'm unsure if related; the "fill and stroke" panel will flicker while editing gradients. When a gradient is selected, click "linear gradient" when you have a gradient ready for moving. When you begin dragging the gradient the list of gradients will begin jumping. I'm unsure if it might be regenerating the gradient list repeatedly, but it may be one of the causes of the leak. Closing the panel does not alleviate the issue.

##Current workaround:

Closing and re-opening Inkscape will free the leaked memory.

Revision history for this message
Nathan Lee (nathan.lee) wrote :

Closing because no longer replicated on master build or 1.0alpha0 appimage release (there is possibly some leakage, but its in the couple MB range, sometimes not growing at all).

In comparison, I tested in 0.92.3 and the 0.92.x branch (Inkscape 0.92.4 (13fe9f3d69, 2019-11-05)) and with the same tests, I get 50MB+ leak and it happens consistently (and continues to grow with more editing).

Tested Linux Mint 19.1

For posterity, updated link to file: https://www.pling.com/p/1170141 (I just searched for casade, with category KDE...)

Closed by: https://gitlab.com/nathanal

Changed in inkscape:
status: New → Fix Committed
tbnorth (terry-n-brown)
tags: added: bug-migration
Max Gaukler (mgmax)
Changed in inkscape:
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.