VST Plug-in parameter changes cause memory usage to rise continuously till crash

David Stolz's icon

Hi, I hope someone out there knows how to fix this:

Changing VST plug-in parameters causes the memory usage of Max to rise slowly until the memory usage would exceed memory capacity (16 GB in my case) and it crashes (sometimes even affecting system stability).

The problem becomes recognizable when changes are applied continuously, e.g. via a signal based modulation or a metro object. If the parameter-changes are applied only now and then, the problem is still existing, but it takes a lot longer till it gets problematic and visible in the windows task manager.
The Memory usage is rising significantly faster with a higher overall size and memory usage of the patch.
Even if the plug-in doesn't process any audio signal, or is seperated from any signal flow, the problem persists.

Already tried solutions and tests:

· tested on various computers with different windows and Max versions using the actual patch an also newly written small example patches with different VST plug-ins.
· All sample rates and buffer sizes
· tried free and paid vst2 and vst3 plugins of a variety of manufacturers.
· using the vst~-object vs. using the drag and drop menu for plugins.
· using usb asio interface (Steinberg UR22 mk2) vs. integrated sound driver
· trying to locate problematic data in the Max folders
· reinstalling Max
· Updating to latest version: 8.2.2 (85d93eb32e9) (x64 windows)
· system reboot

System info: Windows 10 (10.0.19043), intel i7-8700K, 16 GB RAM, nVidia Geforce GTX 1070

Does anyone have an idea what the problem is? I would be very glad to hear!

Example for a simple patch causing the problem. In this case its only about 0.2 MB per second...

vichug's icon

this sounds like a legitimate memory leak bug/issue, i have a feeling it could be related to how patcher snapshots work. Did you send an email directly to support ? I think it would be good !

Andy Maskell's icon

Well something is clearly eating through your memory! Are you sure that you haven't got a situation where one process is interrupting another causing something to reset, thus causing multiple chunks of buffer space to be reallocated repetitively?

It sounds like something outside of Max because I think Max would pick this up and crash first with a warning. If the problem lies within Max, then each crash should be creating a memory dump for you.

If something is writing to memory in an uncontrolled manner then It certainly would run the risk of trashing the OS but even then, the system should create a warning and some sort of memory dump somewhere.

I can recommend you submitting this to tech support to see what they make of it. I have found them extremely helpful and they will certainly want to know if the crashes are being caused by Max.

vichug's icon

Additionally, to get more clues, you can try to disable vst~'s "parameter mode enabled" and/or "autosave snapshot" (in the object inspector) to see if the problem is still here.

Andy Maskell's icon

I created a patch exactly according to your screenshot.

Firstly, it didn't really do anything on its own obviously (so I'm not sure where your audio input is coming from).

Secondly, if I scrolled up and down in the second number box, it certainly changed the mix parameter in Crystalise as I expected and it controlled this from the cycle~ object once audio was started.

Thirdly, as I continued to run it, I saw no evidence of a memory leak occurring and nothing crashed.

So I can't help feeling that you have a problem somewhere else in your system. Have you tried re-installing the plug-in?

David Stolz's icon

Thank you both for the quick answers! That was very helpful! I experimented with the settings “autosave snapshot” and “parameter mode enable” – here are the results:

If autosave snapshot is deactivated and I close and repopen Max and then the patch, Max crashes while opening the patch...

BUT:

parameter mode enable must be turned off!:

Some plugins work now, others need to be reloaded with a snapshot first to output sound at all. Unfortunately, some plugins don’t work with that setting at all... But this is already a major gain for my project!

AND: The patch must be opened manually, not via open recent patch in order not to crash Max.

I will definitely contact the support for that and keep this thread updated with results.

@Andrew Maskell regarding your second response: The patch I posted was only an example and audio needs to be turned on for the cycle~ to operate, but it does cause a memory rise of about 0.1 MB per second on several systems of mine and a friend, but the parameter has to be updated continuously for it to happen. So, I still think it hast something to do with Max, since the problem occurs with every plugin I and my friend have installed.