Skip to content

Document how to set memory limits #102

Description

@Marcono1234

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions