Consider -s MAXIMUM_MEMORY=4GB emcc flag and it's implications for mono VM codebase.
Review other aspects, which may prevent handling large data.
Among others, how many copies of data we have at any time.
----- Original description
Got out of memory when load big file (~1GB) to memory.
// <InputFile OnChange="OnInputFileChange"
async Task OnInputFileChange(InputFileChangeEventArgs e)
{
var file = e.File;
using (var stream = file.OpenReadStream(file.Size))
{
var ms = new MemoryStream((int)file.Size);
await stream.CopyToAsync(ms); // memory access out of bounds | Out of memory
// ...
}
}
=>
Uncaught (in promise) RuntimeError: memory access out of bounds
at <anonymous>:wasm-function[120]:0x53cf
at <anonymous>:wasm-function[3924]:0xc7ead
at <anonymous>:wasm-function[3925]:0xc7f03
at <anonymous>:wasm-function[1749]:0x43fd6
at <anonymous>:wasm-function[3923]:0xc7e2b
at <anonymous>:wasm-function[6542]:0x158b1e
at Object.Module._mono_wasm_string_from_utf16 [as mono_wasm_string_from_utf16] (dotnet.6.0.0-preview.7.21377.19.js:1)
at Object.js_string_to_mono_string_new (dotnet.6.0.0-preview.7.21377.19.js:1)
at Object.js_string_to_mono_string (dotnet.6.0.0-preview.7.21377.19.js:1)
at Object.converter_ssss [as compiled_function] (converter_ssss:11)
Consider
-s MAXIMUM_MEMORY=4GBemcc flag and it's implications for mono VM codebase.Review other aspects, which may prevent handling large data.
Among others, how many copies of data we have at any time.
----- Original description
Got out of memory when load big file (~1GB) to memory.
=>