If possible, could you please extend the documentation regarding how to set memory limits? Currently the documentation just says "set limits" but without telling how exactly.
The documentation regarding CPU limits is already pretty good, but for memory limits it is not directly clear how to apply them.
If I understand it correctly the main class is MemoryLimits, and it can be applied with Instance.Builder#withMemoryLimits. But what I don't fully understand yet is:
- Are there other places to consider?
E.g. there is ImportMemory and MemoryImport, but I assume they are only relevant when you are actually importing memory?
- There is also
TableLimits; is that relevant here as well?
- The limit specified using
withMemoryLimits only seems to apply to memory index 0, is that intentional and does that mean the other memories are not restricted (besides the limit which is specified in the Wasm code itself)?
- The instructions
array.new, array.new_default, array.new_fixed, array.new_data and array.new_elem create a new long[len] and don't seem to be restricted at all?
If possible, could you please extend the documentation regarding how to set memory limits? Currently the documentation just says "set limits" but without telling how exactly.
The documentation regarding CPU limits is already pretty good, but for memory limits it is not directly clear how to apply them.
If I understand it correctly the main class is
MemoryLimits, and it can be applied withInstance.Builder#withMemoryLimits. But what I don't fully understand yet is:E.g. there is
ImportMemoryandMemoryImport, but I assume they are only relevant when you are actually importing memory?TableLimits; is that relevant here as well?withMemoryLimitsonly seems to apply to memory index 0, is that intentional and does that mean the other memories are not restricted (besides thelimitwhich is specified in the Wasm code itself)?array.new,array.new_default,array.new_fixed,array.new_dataandarray.new_elemcreate anew long[len]and don't seem to be restricted at all?