plugdata icon indicating copy to clipboard operation
plugdata copied to clipboard

Resizing canvas label creates memory leak (especially with big font sizes)

Open HurleybirdJr opened this issue 7 months ago • 1 comments

Versions tested: v0.9.1 happens and latest nightly build 885a64577

I was debugging one of my patches that used multiple canvas labels as moving UI elements and started having slow performance/crashes seemingly randomly. I narrowed it down to when I was resizing canvas labels, and my RAM kept getting filled over time until I closed the plugdata instance.

This becomes more apparent when resizing to big label sizes (reaches like almost 1-2GB/s of RAM usage until it maxes out, smaller fonts usually fill around 0.2-1MB/s ish) It starts off stable, then within like 10 ish seconds, starts filling up quickly, regardless of font used.

Image

I've included an example patch below to demonstrate:

[!WARNING] Be careful not to resize too quickly or too much or RAM will get filled really fast lol :D

HurleybirdJr avatar May 31 '25 21:05 HurleybirdJr

Example patch:

#N canvas 827 239 527 327 12;
#X obj -143 189 hsl 128 17 1 1000 0 0 empty empty empty -2 -8 0 10 #191919 #ffffff #ffffff 0 1;
#X obj -146 263 send egg;
#X obj 0 0 cnv 15 100 60 empty egg EGG! 2 4 1 16 #5e625f #04b0ff 0;
#X obj -125 -14 tgl 25 0 empty empty empty 17 7 0 10 #191919 #ffffff #ffffff 0 1;
#X obj -146 113 spigot;
#X obj -146 79 sin;
#X obj -146 154 * 800;
#X obj -146 36 phasor 5;
#X msg -146 223 label_font 0 \$1;
#X connect 0 0 8 0;
#X connect 3 0 4 1;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
#X connect 6 0 0 0;
#X connect 7 0 5 0;
#X connect 8 0 1 0;

HurleybirdJr avatar May 31 '25 21:05 HurleybirdJr

Thanks for reporting! 77b86772f should fix it

timothyschoen avatar Jul 13 '25 18:07 timothyschoen

Awesome! Thanks for the fix <3

HurleybirdJr avatar Jul 13 '25 21:07 HurleybirdJr