I noticed that starting the benchmark allocates an enormous amount of
memory.  The reason seems to be Foreach{,2,3,4} benchmarks.  Each of
these has the line

  array const_array = enumerate(10000000);

on the top level.  This means that there is an object occupying 160M
(10M * sizeof(svalue)) in each of these _programs_, so it is always
present when the programs are loaded, not just when the benchmarks are
run.

So in short, loading these four benchmarks (pike -x benchmark loads
all the benchmarks) allocates 640M ram.  That's a bit steep for my
Raspberry Pi which only has 1G in total...  (If I change the size of
the arrays to 3M elements then the benchmarks complete normally.)

Could perhaps each of these arrays be allocated before the respective
benchmark is run, and freed afterwards, instead of being allocated
when the benchmark is loaded and freed never?

Reply via email to