Memory increase when loading and unloading tox

We noticed a strange behavior when we load and unload a tox within a Touch Designer project.

When we load the tox the memory for the touch instance increases, and when we unload it, apparently, the memory does not free the tox resources. Consequence, if we do this operation several times, and we need to do it on our projects, the memory keeps increasing …

This only seems to happen if the loaded tox has custom parameters defined.

Sending an example
MemoryLeak.zip (9.9 KB)

We’ve tested on the latest version of touch designer (TouchDesigner.2023.11290) but it also occurs on the previous versions.

Can you help with this please?

Thanks

Hi @gotv,

thanks for the message and the example. Can confirm this behavior and we are looking at it.

cheers
Markus

The issue here is a UI cache that is used to speed up rendering parameter dialogs with custom parameters. Each time the tox is loaded it is creating a new dialog template internally and at the moment we don’t have a system to clean up cached items that are no longer in use.

You should be able to confirm this if you turn off the parameter dialog in your example (press ‘p’ key). The cache is only created after the node is selected and the dialog appears, so without the dialog open the mem usage should be stable. This also means that it shouldn’t appear in a production in perform mode if that helps.

That said, we are looking into ways now that we can improve the cache so that this is less of an issue. Thanks for the report.