&gt; The question is not, can it be done, but rather what&#x27;s easier and lower cost?<p>I thought it was about speed.<p>&gt; The C++ equivalent would be to allocate as much as possible on the stack, and then make sure to do a restart every night to eliminate any heap fragmentation that is left.<p>The C++ equivalent would be to do heap allocation and never free, then shut the process down which will return its memory to the OS.  Heap fragmentation wouldn&#x27;t matter here since you aren&#x27;t freeing any memory.<p>Fundamentally if you can avoid freeing any memory all day then you should just allocate it up front an be done with it. Anything else is ignoring the more fundamental point that you are using a limited amount of memory and pretending that you aren&#x27;t.