I have a question…
Can I set asterisk maximum memory usage?
Not in a way that won’t cause it to crash.
If you have so many active calls that you are running out of memory, you probably need to be running on a dedicated machine, in which case there will be a hard limit to RAM.