tracktion::Plugins keep using RAM even when disabled?

Happy new year and hope you’ve all had a very happy holiday season :slight_smile:

Currently we have the behaviour where when we enable plugins RAM usage always goes up, but never goes down when we disable them. I’m not sure if this is the intended behaviour or if we might be doing something wrong here.

Was wondering if @dave96 might be able to help point me in the right direction here?

Wondering if there are some easy wins here or common pitfalls which we could be avoiding?

All the best!

Jamie

There’s a few things that could be going on here.

Firstly, where are you tracking RAM usage? Are you sure this isn’t just an artefacts of the memory manager? It could be allocating some pages but just keeping them mapped rather than freeing them completely?

Secondly, what plugins are you experiencing this with? And how much memory is being added each time?

Then how are you enabling/disabling the plugins? If you’re just using te::Plugin::setEnabled, why would you think that memory would be freed when they’re disabled? This is generally a quick “bypass” control that can be toggled on/off during playback so plugins can’t do anything non-real-time-safe such as allocating/freeing memory when its changed.

I think you might need to describe a specific use case to narrow down the scope a bit.

2 Likes

Yeah that makes sense. We’ve just done some work to share resources like FFT objects and optimise delay buffers etc and we’ve brought down our usage by quite a lot so I think it was just the fact we had a bunch of plugins which were greedy with RAM :slight_smile:

Thanks for your input on this one!