http://bugs.winehq.org/show_bug.cgi?id=59916 Bug ID: 59916 Summary: d2d1 path geometry leaks figure->vertex_types (steady heap growth under sustained Direct2D path rendering) Product: Wine Version: 11.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: d2d Assignee: wine-bugs@list.winehq.org Reporter: nen24t@gmail.com Distribution: --- While investigating bug 59857 (unbounded RSS growth with a Direct2D plugin GUI) I tracked down one concrete, separate cause inside d2d1 itself. The applications I see it in: REAPER and FL Studio (both Windows DAWs running under Wine) hosting Serum 2, a VST3 synth whose GUI is drawn with Direct2D and continuously animates a waveform/path display. With the plugin GUI open and the transport playing, the process RSS climbs steadily and never recovers when drawing stops. This is plain vanilla Wine -- current master (11.11) and 11.0 stable, OpenGL backend, no DXVK or other third-party D3D layer, no patches. The cause is a missing free in the path-geometry code. In dlls/d2d1/geometry.c a figure's vertex_types array is allocated as the figure grows (d2d_figure_add_vertex and d2d_figure_insert_vertex, via d2d_array_reserve), but d2d_figure_cleanup() frees the figure's vertices, bezier_controls, original_bezier_controls and segments.data and never frees vertex_types. There is no free(figure->vertex_types) anywhere in dlls/d2d1. vertices and vertex_types are sibling per-vertex arrays that grow together, yet only vertices is released, so every path figure that is built and torn down leaks its vertex_types array. A GUI that redraws Direct2D paths continuously builds and frees a very large number of figures, so this accumulates without bound. This is one well-defined slice of the growth reported in 59857. The bulk of 59857 looks like ntdll heap subheap retention (a structural allocator effect); this one is a plain missing free, independent of that and trivially fixable. I tested a local vanilla build with the missing free added (free(figure->vertex_types) in d2d_figure_cleanup, next to free(figure->vertices)). Under the same workload the growth from this path goes away -- RSS plateaus after the initial warmup instead of climbing monotonically -- and there is no rendering regression in any of the Direct2D-drawn plugin GUIs I checked. vertex_types is not aliased or ownership-transferred anywhere, so adding the free is safe. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.