Skip to content

Limit memory usage by wasm code #33

Open
@WhaleKit

Description

@WhaleKit

Currently there doesn't seem to be api to stop wasm code from hogging up ram, such as by growing tables and memories

I'm ready to start implementing it, but i'd like to discuss the API

  • Something like "store.set_max_ram" might suffice, but for things that aren't in linear memory, ram consumption could differ between tinywasm versions
  • we could have set_max_ram and also have user assign "cost" to each category (how much per reference in table, per call frame, per variable of each type on stack/in locals)
  • we could have user callback that receives how much in every category is already allocated (in tables, linear memories, call frames, etc) before approving/denying new allocation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions