dicej opened issue #8504:
While working on resource support for the C#
wit-bindgen
generator, I created an example app targetingwasi:http/incoming-handler@0.2.0
. However,wasmtime serve
couldn't run it due to one of the tables containing more than 10000 entries:$ wasmtime serve target/stripped.wasm Error: table index 0 has a minimum element size of 10511 which exceeds the limit of 10000
Next, I tried
wasmtime serve -W max-table-elements=20000 target/stripped.wasm
instead, but got the same error. Looking at the code, it seems that the pooling allocator is enabled by default forwasmtime serve
, and since it has its own configuration knobs which are not controlled by e.g.-W max-table-elements
, there's no way to change the limit from its default. There's also no way I can see to disable the pooling allocator, given that the only reference to the--pooling-allocator
option is inold_cli.rs
, which is disabled in the default build.I'd suggest that
-W
options such asmax-table-elements
should be applied to the pooling allocator when it is enabled. We might also consider raising the default considering that even simple C# apps tend to exceed it (although we could instead consider that a bug in the C# Native AOT compiler).
dicej edited issue #8504:
While working on resource support for the C#
wit-bindgen
generator, I created an example app targetingwasi:http/incoming-handler@0.2.0
. However,wasmtime serve
couldn't run it due to one of the tables containing more than 10000 entries:$ wasmtime serve target/stripped.wasm Error: table index 0 has a minimum element size of 10511 which exceeds the limit of 10000
Next, I tried
wasmtime serve -W max-table-elements=20000 target/stripped.wasm
instead, but got the same error. Looking at the code, it seems that the pooling allocator is enabled by default forwasmtime serve
, and since it has its own configuration knobs which are not controlled by e.g.-W max-table-elements
, there's no way to change the limit from its default. There's also no way I can see to disable the pooling allocator, given that the only reference to the--pooling-allocator
option is inold_cli.rs
, which is disabled in the default build.I'd suggest that
-W
options such asmax-table-elements
should be applied to the pooling allocator when it is enabled. We might also consider raising the default considering that even simple C# apps tend to exceed it (although we could instead consider that a bug in the C# Native AOT compiler, e.g. insufficient dead code elimination?).
dicej edited issue #8504:
While working on resource support for the C#
wit-bindgen
generator, I created an example app targetingwasi:http/incoming-handler@0.2.0
. However,wasmtime serve
couldn't run it due to one of the tables containing more than 10000 entries:$ wasmtime serve target/stripped.wasm Error: table index 0 has a minimum element size of 10511 which exceeds the limit of 10000
Next, I tried
wasmtime serve -W max-table-elements=20000 target/stripped.wasm
instead, but got the same error. Looking at the code, it seems that the pooling allocator is enabled by default forwasmtime serve
, and since it has its own configuration knobs which are not controlled by e.g.-W max-table-elements
, there's no way to change the limit from its default. There's also no way I can see to disable the pooling allocator, given that the only reference to the--pooling-allocator
option is inold_cli.rs
, which is disabled in the default build.I'd suggest that
-W
options such asmax-table-elements
should be applied to the pooling allocator when it is enabled.We might also consider raising the default considering that even simple C# apps tend to exceed it (although we could instead consider that a bug in the C# Native AOT compiler, e.g. insufficient dead code elimination?).EDIT: I was building with-c Debug
; the release build results in a table about half the size, which is well under the current default limit.
dicej commented on issue #8504:
As I noted in my edit above, building the C# app using
-c Release
ensured that the max table size in the component was well under the default limit, but then I ran into what appears to be an allocation failure during .NET runtime initialization, possibly due to the default memory pages limit being lower than what the .NET runtime needs. I'm going to test that theory using a custom build and report back here.
dicej commented on issue #8504:
Indeed, setting the memory pages limit to 1600 (i.e. 100MiB) allows the app the run without trapping.
alexcrichton closed issue #8504:
While working on resource support for the C#
wit-bindgen
generator, I created an example app targetingwasi:http/incoming-handler@0.2.0
. However,wasmtime serve
couldn't run it due to one of the tables containing more than 10000 entries:$ wasmtime serve target/stripped.wasm Error: table index 0 has a minimum element size of 10511 which exceeds the limit of 10000
Next, I tried
wasmtime serve -W max-table-elements=20000 target/stripped.wasm
instead, but got the same error. Looking at the code, it seems that the pooling allocator is enabled by default forwasmtime serve
, and since it has its own configuration knobs which are not controlled by e.g.-W max-table-elements
, there's no way to change the limit from its default. There's also no way I can see to disable the pooling allocator, given that the only reference to the--pooling-allocator
option is inold_cli.rs
, which is disabled in the default build.I'd suggest that
-W
options such asmax-table-elements
should be applied to the pooling allocator when it is enabled.We might also consider raising the default considering that even simple C# apps tend to exceed it (although we could instead consider that a bug in the C# Native AOT compiler, e.g. insufficient dead code elimination?).EDIT: I was building with-c Debug
; the release build results in a table about half the size, which is well under the current default limit.
Last updated: Dec 23 2024 at 12:05 UTC