is the SMALL_MEMORY define deprecated? (no) Why is it only used for VxWorks?

Matthias Lang <>
Mon Dec 13 12:49:47 CET 2010


I noticed the 'SMALL_MEMORY' define in the emulator source. It's only
ever enabled for vxworks, in sys/vxworks/erl_vxworks_sys.h.

Question 1: is SMALL_MEMORY deprecated? (it's not documented anywhere)

Question 2: is there a known problem using it for non-VxWorks targets?

Question 3: is anyone else using that define on a non-VxWorks system?

I tried it out on my target hardware, a 32-bit MIPS linux system. It
passes my whole test suite and cuts memory use from about 9M to about
8M. Not bad for no effort on my part. I haven't measured performance.

Going through the code, it has these effects:

  - Disables all (?) of the optional memory allocators. Similar
    (same?) effect can be achieved with +Mea min (erl_alloc.c)
  - Sets lower sizes/thresholds for block sizes and parameters in
    memory allocators, often half or a quarter. (erl_alloc.c,

  - Cuts the timer hash table to 1/3 size. (erl_bif_timer.c)

  - Cuts the timing wheel from 256k to 32k (time.c)

  - Makes processes more "GC happy". (erl_process.h)

none of that seems scary. Have I missed anything?


More information about the erlang-questions mailing list