[CM] setting heap size preemptively at startup?

Elijah Stone elronnd at elronnd.net
Thu Sep 9 21:41:57 PDT 2021


On Thu, 9 Sep 2021, Iain Duncan wrote:

> Is there a way to pre-emptively make the heap big from c or scheme, 
> aside from compiling in a default size?
(set! (*s7* 'heap-size) ...)

> 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.
That is very reasonable, but note that you cannot shrink the heap.

> does a heap resize take a long time?
It requires copying the entire heap.  Probably not something you would 
want to do in real-time.

> Do they take progressively more time (ie does the heap double or 
> somesuch thing)
Yes, it doubles.  (Obviously this also means you're asymptotically less 
likely to need a resize as time goes on...)

  -E


More information about the Cmdist mailing list