gen~, MC and JS inside a poly~ :)
Hi,
I'm trying to work on multithreading for an update to my WFS system.
Until now I had a poly~ with some gen in it and a JS script to handle the number of IO channels and connect all this together. No problem in Max 7 or 8.
Today I thought I would build something similar with MC wrapped objects to streamline the inside of the poly~. So I build a couple of abstractions that will be instantiated inside the poly~by some JC scripts. When I build them one at a time by hand everything is fine.
When I have to build a single instance of the poly~ if it contains more than one of the abstractions that contain the gen bits then I get a memory leak and I have to kill Max. Removing this abstraction solves the memory leak.
When I build exactly the same content by hand, I don't have any issue.
When instead of the abstraction I create loadmess objects with the script, no problem. And if I replace loadmess by the abstraction name then everything seems to work ok. It's like it's not handling too many instances at the patch's launch.
I tried to add #0 to the scripting names of the boxes I have to connect and it didn't help.
I would have added a delay in the JS script to slow things down since it looks like it's part of the problem, but I have several scripts going at the same time when launching the patch with the poly~ and there is no native delay/sleep function.
I'll try and clean up the patches and upload them.
Hi Pierre-Olivier
here with Kapitan and MBPro 2012 Max 8.02 leaks too. I don't know about js. I use much script and thispatcher inside poly~, taking care to mute the poly~every time i create an object or load a patch.
Bonne journée
michel
Bonjour Michel,
Merci pour la confirmation.
This is happening with audio off. And I've done some pretty serious dynamic patching in previous projects that still work in Max8. The difference I see here is that there are some mc.objects. From what I can tell it's crashing when connecting the gen~ box to the mc.unpack and mc.pack when there are other instances doing the same at the same time.
Adding #0 to the script names for locality didn't help either.
I worked around it by delaying a little for each input abstraction the dynamic patching. I use the input channel number *10ms which avoids the memory leak.