Closed radu-matei closed 2 years ago
See https://github.com/SteveSandersonMS/dotnet-wasi-sdk/issues/11#issuecomment-1207839328 for info about why that happens.
The TLDR is that it's pointless to preallocate so much, and it will be reduced to 50MB in the next update, hopefully this week (just waiting for one more .NET runtime commit to merge first). We could certainly add an MSBuild property to control the initial heap size, but it isn't safe to declare less than about 24MB.
Is this good enough for your requirements?
50 MB default is great in the next update, sure!
I would go with your recommendation for what should be the default here — I would like to experiment with ~32MB, so being able to configure it would be great, but 50MB is excellent for the time being, thanks!
The updated version is now published: https://www.nuget.org/packages/Wasi.Sdk/0.1.2-preview.10061
One of the next main things I'll be adding is this: https://github.com/SteveSandersonMS/dotnet-wasi-sdk/issues/30, which should make it possible to simplify your interop further by eliminating most or perhaps all of the C code.
Thank you so much for your help, Steve!
At startup, the simple "hello world" example currently allocates around 500MB of memory — and I suspect at least some of that is the runtime eagerly allocating, rather than all that actually being used.
Is there a way to control how much memory (and when) gets allocated at startup by the runtime?
cc @SteveSandersonMS