Skip to content

Limit memory usage by wasm code #33

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions