grain icon indicating copy to clipboard operation
grain copied to clipboard

Decrease initial memory pages to 1

Open ospencer opened this issue 1 year ago • 3 comments

I arbitrarily chose the number 64 way back when. I don't know why.

The Grain runtime reserves 2k of space for itself (and only uses about 1k). A hello world program uses only about 400 bytes of actual allocated memory.

I don't think we need to start programs with 4 megabytes of memory 😛

ospencer avatar Apr 21 '24 18:04 ospencer

Can I work on this issue? If I can, what files need to need or do I need to look at?

AjaySDwivedi1 avatar Apr 21 '24 23:04 AjaySDwivedi1

@AjaySDwivedi1 sure! It's mainly changing this line: https://github.com/grain-lang/grain/blob/main/compiler/src/utils/config.re#L367

There may be some references to this number in the CLI docs, so you'd just need to search code nearby initial_memory_pages or initial-memory-pages.

ospencer avatar Apr 22 '24 00:04 ospencer

@ospencer for the code that has initial_memory_pages or initial-memory-pages, what changes need to be made? I checked them and I didn't know what to change.

AjaySDwivedi1 avatar Apr 22 '24 20:04 AjaySDwivedi1