Memory usage per node/thread/loop, how to get data?

Hi everyone, good morning
i am wondering how to get those data from the output console in Spi.

to give more details about it, i want to study the ressources usage for each of my blocks, compare the use of synth/sample, get precise calculations and finally, get a real time info about the memory during performance to not get stuck in the middle because i am abusing of adding more and more sounds…

also, if there is a way to get the full memory usage per buffer or for all buffers together will be a +


Hi there,

this data isn’t available from the app, sorry. Sonic Pi is actually made of a number of processes with their own specific memory profiles. There’s the Ruby language process, the BEAM Erlang process and also the synths are running within SuperCollider. The memory usage for a buffer would therefore actually be a slice of all these processes and it would be very hard to gain a snapshot of this - especially as they all use memory very differently.

Hi Sam, thank for your answer :slight_smile:
ok, understood, but as a complete memory usage from SCol, is this possible to get the calculated value, set on frequencies (e.g. 1s) ?

Apologies, I’m not sure what you mean here.

I honestly haven’t done any live memory profiling on SuperCollider. The only performance testing I’ve done is “does it work”. The main limitations are typically that it is CPU bound and “does it work” is easy to determine because if it’s doesn’t, you get buffer underruns which have a very specific sound.

By default SuperCollider doesn’t use much memory at all - it allocates it all up front and does its own internal memory management within that pre-allocated block to minimise the number of OS malloc calls which can introduce arbitrary delays.

The only thing that can really cause SuperCollider to consume a lot of memory is to load up a bunch of samples. There’s a malloc for each of these as internal buffers are created for the audio wave file to be stored in memory.

Synthdefs essentially do not use additional memory beyond what is initially allocated at boot (which can be configured using the audio settings file in ~/.sonic-pi/config.


ok, perfect…you did answered 2 of my doubts at the same time… nice one !
thx, have a nice day :slight_smile: