Occasionally I had a look at /dev/memory:
What I saw there?
; cat /dev/memory
2282656 14018478 2314496 14149 6246 18 11735810 main
492768 7009239 499488 110133 106946 4 6516459 heap
4960 14018478 4960 8 1 1 14013506 image
;
What? I run my Inferno just on 14+7+14 = 33MB memory? (yep and it still runs ok ;) )
The code that define size of memory pools was just copied from other ports:
ulong nb;
ulong mpb,hpb,ipb;
nb = conf.npage*BY2PG;
mpb = (nb*main_pool_pcnt)/100;
hpb = (nb*heap_pool_pcnt)/100;
ipb = (nb*image_pool_pcnt)/100;
poolsize(mainmem, mpb, 0);
poolsize(heapmem, hpb, 0);
poolsize(imagmem, ipb, 0);
See something dumb? :)
240MB memory is not safe to use in calculations because ulong cab be easily overflow to 4GB :)
Yep – 240MB * 50 (%) = 12 000 000 000.
Oops, all previous releases of inferno-rpi have only 33MB RAM. SORRY :)
Surely fixed and coming in next release soon…
Now it is right:
; cat /dev/memory
2400480 99917824 2434464 14596 6408 18 97517332 main
498688 49958912 500576 110906 107649 4 49460212 heap
4960 99917824 4960 8 1 1 99912852 image
;