Size, Position and Rotate - doesn't release memory when scaling?

Hmmm… that’s not good that it’s not possible to solve this problem (or at least not easy) as it might discourage many people from using shotcut in a bit bigger projects (mine is currently 5 min and I don’t have enough memory).

I’m wondering if it’s the problem of these two filters being together, of some more general problem of mechanism creating a new frame and executing filter by filter? As the error can be either in one of those two filters or in this general mechanism being one step above (coordinator). In the second case it might happen that some other filters being together cause memory leaking. It might be more visible in case of those two filters as they use big amount of data but in practice it might concern more filters?

What comes to my mind, but please treat this as very general ideas as definitely I’m not expert here, in particular not in shotcut “programming construction”, it looks like that additional copy of frames or jpg source files are created and not being released. Do you use copy constructors somewhere? Sometimes they are used to transfer big memory areas between objects but if it’s in incorrect way, it happens that instead of one expected copy, we have two and one is some kind of orphan.

When playing with different filters I also noticed some time ago, but here I’m not fully sure, that is looks like that most of them works on the output from the previous filter (if we have many in array, which is of course expected) but I found one or two which seemed to work on input image (the image “send” to the first filter) and not on the output of the previous filter. However I didn’t report this and now I don’t remember details.

I will try to make more “playing” with this problem and if I find sth interesting which could suggest the reason more in details, I will let you know.

Edit: I executed some additional tests to check if changing any parameters within these two filters will have impact on this memory leaking. I expected that no, but just in case I checked it and it confirmed my expectations. Additionally adding any additional filters before these two, or removing alpha channel after corner pin and before size, position and rotate doesn’t help.

In case of Corner Pin, I did: 1) changed position of corners 2) changed interpolator 2) changed alpha operation (sure not all possible values but some).

In case of Size, Position & Rotate, I did: 1) changed size mode from fill to fit 2) changed background colour to black instead of transparent.

Additionally in editing more, I unmarked Realtime (frame dropping) option and hit Play. Then also it caused significant memory leaking.

I also made one experiment more: two times the same corner pin filter (and no size… at all) either two times the same size, position and rotate (and no corner pin). It seems that this problem doesn’t occur then (or in very small almost invisible way as I didn’t use any professional memory profiler, just simple tool).

Probably it will not help too much, but just in case…