Skip to content

How to get the used memory of a webassembly instance in real time #22859

@wohencainiao

Description

@wohencainiao

When I create an instance of webassembly, I use the MAXIMUM_MEMORY compilation directive to limit the maximum memory to 1023M,Then I'll load the webassembly instance in Google Chrome and run it,During use, I need to request new memory until the maximum memory limit is reached,Then the Google Chrome console will report an error “Cannot enlarge memory, asked to go up to 1078722560 bytes, but the limit is 1072693248 bytes”,I don't want Google Chrome to get an error,So I'm wondering if there are some methods or functions that let me get the memory usage of my webassembly instance,So that in my code I can judge for myself that new memory is not allowed to be requested when the maximum memory limit is about to be exceeded,thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions