< Back to IRCAM Forum

Crashing and memory overload with spat5.trajectories / spat5.viewer

Hello,

I am working with spat5.trajectories, spat5.transform, and spat5.viewer.embedded and am seeing intermittent issues with crashing as well as application memory overloads.

Here are steps to reproduce the memory issue:

  • Load the attached patch, which includes this patch inside of bpatcher within the parent patch.
  • Open Activity Monitor on Mac and go to the memory tab. Note the memory being used by Max.
  • From the parent patch, click the live.toggle to start the trajectory. Check the Activity Monitor - the memory for Max should change only slightly
  • Open the bpatcher. Check the Activity Monitor - Max’s memory use will fill until the OS shows a warning

2024-08-11_viewer_memory-issue.maxpat (33.1 KB)

Here is a video documenting this process: https://www.youtube.com/watch?v=T-YTWBSRCkY.

For the crashing, I’m not able to provide specific reproducable steps - the issue is intermittent but frequent enough to be a problem. I have attached a crash report
crashreport.rtf (169.8 KB). I’m not an expert at reading these, but it seems to suggests that the problem is related to TrajectoriesProcessor.

My Spat 5 package info:

{
	"name" : "spat5",
	"description" : "software suite for real-time sound spatialization and artificial reverberation",
	"author" : "Ircam Centre Pompidou",
	"tags" : [ "sound spatialization", "reverberation" ],
	"homepatcher" : "",
	"max_version_max" : "none",
	"max_version_min" : "8.0.0",
	"os" : 	{
		"macintosh" : 		{
			"platform" : [ "x64", "arm64" ],
			"min_version" : "10.11.x"
		}
,
		"windows" : 		{
			"platform" : [ "x64" ],
			"min_version" : "10"
		}

	}
,
	"version" : "5.3.3",
	"website" : "https://forum.ircam.fr/projects/detail/spat/"
}

Max Support Information

{
	"version" : "Version 8.6.4 (0112d5ff36b) (arm64 mac)",
	"platform" : "mac",
	"arch" : "arm64",
	"osversion" : "Mac OS X Version 13.6.7 (Build 22G720) arm64",
	"samplerate" : 88200,
	"iovs" : 512,
	"sigvs" : 64,
	"scheduler_in_audio_interrupt" : "on",
	"audio_drivername" : "Core Audio",
	"audio_driver_subname" : "",
	"license" : "permanent full",
	"machine_id" : "33b2d95acdfa379d0292a15379e68b8a",
	"addons" : 	{
		"rnbo_v1" : "full license"
	}
,
	"eventinterval" : 2,
	"schedinterval" : 1.0,
	"overdrive" : "on",
	"pollthrottle" : 40,
	"queuethrottle" : 100,
	"sysqelemthrottle" : 1000,
	"refreshrate" : 30.0,
	"schedslop" : 25.0,
	"eventprobing" : 1,
	"mixerparallel" : "off",
	"mixercrossfade" : 0,
	"mixerlatency" : 30.0,
	"mixerramptime" : 10.0,
	"videoengine" : "avf",
	"gfxengine" : "glcore",
	"packages" : 	{
		"AHarker Externals" : "1.0.0",
		"AudioMix" : "1.0.3",
		"BEAP" : "1.0.4",
		"bl" : "1.0.0",
		"CNMAT Externals" : "1.0.5",
		"cv" : "",
		"Dots" : "",
		"ease" : "1.2.3",
		"FluidCorpusManipulation" : "1.0.7",
		"gen-filters" : "1.0.0",
		"gen-rack" : "",
		"gl3" : "0.3.3",
		"go" : "1.0.0",
		"hap" : "1.0.6",
		"jit.mo" : "1.1.6",
		"Jitter Tools" : "1.0.10",
		"JSUI Analog Knob" : "0.0.0",
		"Learn Max" : "0.1.0",
		"link" : "1.5.5",
		"Max for Live" : "1.0.9",
		"max-mxj" : "8.2.0",
		"maxdevtools" : "",
		"maxforlive-elements" : "1.0.12",
		"Meristream" : "",
		"Mira" : "1.2.2",
		"ml.star" : "1.3.0",
		"Node for Max" : "2.1.3",
		"odot" : "1.3.6",
		"pdm" : "0.0.0",
		"philip-meyer-max-tutorials" : "",
		"Rhythm and Time Toolkit" : "1.0.0",
		"RNBO" : "1.2.6",
		"seq-dev" : "",
		"spat5" : "5.3.3",
		"Syphon" : "1.0.9",
		"th.scala" : "",
		"VIDDLL" : "1.2.8",
		"Vizzie" : "2.2.2"
	}

}

Hello Philip,

Thanks for the quite detailed report. Thanks to this, I have found and (hopefully) fixed a serious memory leak in spat5.viewer.embedded. The error in the code was relatively subtle, but the consequences were quite dramatic, as you noticed.

As for the crashing, my guess is that it was an aftermath of the memory leak.

Please find below a beta build (for macOS) including the bug fix. Please give it a try and let me know how it goes.

Thanks again for your contribution.
T.

https://filesender.renater.fr/?s=download&token=e5b0c62f-ee93-46e4-ae75-6304840f6525

Thank you Thibaut! I will install the beta package and let you know how it goes.

Hi Thibaut,

I installed the beta and have not reproduced the memory leak but have been experiencing crashing. I’ve attached a crash report. Like before, it is sporadic, but seems to occur when I am sending streams of trajectory messages for multiple sources. Please let me know if there is any additional information you would like for me to provide.

crashreport_2024-08-14.txt (251.6 KB)

{
	"version" : "Version 8.6.4 (0112d5ff36b) (arm64 mac)",
	"platform" : "mac",
	"arch" : "arm64",
	"osversion" : "Mac OS X Version 13.6.7 (Build 22G720) arm64",
	"samplerate" : 88200,
	"iovs" : 512,
	"sigvs" : 64,
	"scheduler_in_audio_interrupt" : "on",
	"audio_drivername" : "Core Audio",
	"audio_driver_subname" : "",
	"license" : "permanent full",
	"machine_id" : "33b2d95acdfa379d0292a15379e68b8a",
	"addons" : 	{
		"rnbo_v1" : "full license"
	}
,
	"eventinterval" : 2,
	"schedinterval" : 1.0,
	"overdrive" : "on",
	"pollthrottle" : 40,
	"queuethrottle" : 100,
	"sysqelemthrottle" : 1000,
	"refreshrate" : 30.0,
	"schedslop" : 25.0,
	"eventprobing" : 1,
	"mixerparallel" : "off",
	"mixercrossfade" : 0,
	"mixerlatency" : 30.0,
	"mixerramptime" : 10.0,
	"videoengine" : "avf",
	"gfxengine" : "glcore",
	"packages" : 	{
		"AHarker Externals" : "1.0.0",
		"AudioMix" : "1.0.3",
		"BEAP" : "1.0.4",
		"bl" : "1.0.0",
		"CNMAT Externals" : "1.0.5",
		"cv" : "",
		"Dots" : "",
		"ease" : "1.2.3",
		"FluidCorpusManipulation" : "1.0.7",
		"gen-filters" : "1.0.0",
		"gen-rack" : "",
		"gl3" : "0.3.3",
		"go" : "1.0.0",
		"hap" : "1.0.6",
		"jit.mo" : "1.1.6",
		"Jitter Tools" : "1.0.10",
		"JSUI Analog Knob" : "0.0.0",
		"Learn Max" : "0.1.0",
		"link" : "1.5.5",
		"Max for Live" : "1.0.9",
		"max-mxj" : "8.2.0",
		"maxdevtools" : "",
		"maxforlive-elements" : "1.0.12",
		"Meristream" : "",
		"Mira" : "1.2.2",
		"ml.star" : "1.3.0",
		"Node for Max" : "2.1.3",
		"odot" : "1.3.6",
		"pdm" : "0.0.0",
		"philip-meyer-max-tutorials" : "",
		"Rhythm and Time Toolkit" : "1.0.0",
		"RNBO" : "1.2.6",
		"seq-dev" : "",
		"spat5" : "5.3.4",
		"Syphon" : "1.0.9",
		"th.scala" : "",
		"VIDDLL" : "1.2.8",
		"Vizzie" : "2.2.2"
	}

}

Hi Philip,

At the moment, I cannot reproduce the crash.
Could you please send the more complete patcher where it occurs (you sent me “2024-08-11_viewer_memory-issue.maxpat”, but the crash seems to happen in more complex context) ?

And any other hint to reproduce (e.g. how many sources/trajectories are you using ?)

Thanks in advance,
T.

Hi Thibaut,

Noted! I will work on building a patch that is able to reproduce the issue and get back to you.

Some quick notes on the patch I was using:

I had 8 instances of spat5.trajectories and two instances of spat5.viewer.embedded. The first viewer was used to allow the user to manually position sound objects for each of the 8 sources. The output of this viewer was added to the output of spat5.trajectories, and the result was passed to the second viewer instance (with /source/*/editable 0 and source/*/history/visible 1) to visualize the actual position of the sources with history. The crash always occurred when starting to send trajectories from a new trajectories instance.