Why is Shotcut so memory hungry?

Hello.

I see that there have been several posts regarding Shotcut and memory consumption on this forum. However, I haven’t seen anyone having the same issue as me. If I’ve overlooked an older post, please point me to the source.

I’m using the latest Shotcut on my Linux system with 32 GB of RAM. However, strangely enough, it’s not enough. Shotcut is very memory hungry. I do wonder why. I am using the AppImage version of Shotcut as I have been told to do so in this very forum. Has the AppImage version something to do with this? There seems to be a memory leakage of some sort. Opening and closing projects consume more and more memory until there is nothing left. I constantly have to restart Shotcut for freeing up memory.

For example, after having opened a project, edited it, and closed it without exiting Shotcut itself, Shotcut is consuming more than 16 GB of RAM:

fbk_20200730141527_389x84

fbk_20200730141714_689x485

Obviously, memory usage depends a lot on your project and preview resolution (Video Mode and Preview Scaling respectively) but also the number of tracks. As tracks are increased, caching is increased. Also, there is memory pooling such that frequently used blocks of memory are held, not released to the system, and recycled. Lastly, File > Close is not thorough. It is only enough to make it appear closed and facilitate workflow. If you inspect the open files, this is clear. Some panels and models are still holding references to objects until they are replaced by a new object. If you then open another project, the old references are release and the pool is purged of unused blocks (purge added in v20.07).

If you use Preview Scaling (possibly in conjunction with Proxy) it uses less memory. Also, there is more work to be done to ensure there are no reference leaks and make the close operation thorough. I just opened a project and played it through. At the end, it consumed 1.4 GB. I repeated this 4 more times, and it was consuming 4 GB, which is too much but not 1.4*5 (7 GB). Do you want to help?

Thanks a lot for getting back to me with useful information.

I’m afraid I would not be of much help if I messed with the C++ code. It’s no my cup of tea. However, maybe there is some testing related this issue I can do for you guys?