[CM] setting heap size preemptively at startup?
iainduncanlists at gmail.com
Thu Sep 9 21:29:31 PDT 2021
Hi folks, I'm doing more experimenting with tweaking s4m for real time use,
and have yet more gc related questions.
Is there a way to pre-emptively make the heap big from c or scheme, aside
from compiling in a default size? It appears from my recent tests like
quite a feasible approach for some use cases is to just lock the gc out for
the duration of a song. I ran a pretty heavy (by my standards, it's all
note rate stuff) ensemble with the gc turned off, and got bored after 15
minutes so turned it back on. The only downside I noticed was that when I
turned it back on it took 0.2 seconds to run, which would be a catastrophe
normally, but is quite reasonable to do between pieces. That said, I wasn't
recording, so it's conceivable that heap resizing is also causing an
underrun that I didn't notice. So I'm wondering if it would be reasonable
to give users an option to trade size for speed by allocating a big hunk of
memory and cleaning up when it doesn't matter.
Of course, I'm in way over my head here, so if there are other Bad Things
about this approach I'd love to hear them. Like, does a heap resize take a
long time? Is there a way to see how long it took? Do they take
progressively more time (ie does the heap double or somesuch thing)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cmdist