Skip to content

Memory grows each time the page refresh until error appear : Uncaught RangeError: WebAssembly.Memory(): could not allocate memory #8126

@pierreglibert

Description

@pierreglibert

Hi community :)
I get an error after several refresh : Uncaught RangeError: WebAssembly.Memory(): could not allocate memory.

When I go to "inspect > memory > Select Javascript VM instance", memory grows each time I refresh the page.
When memory is bigger than 40mo, the error appear.
How can I clear memory on refresh page ?
The memory should not be deleted automatically ?

My code :
`extern "C" {

void EMSCRIPTEN_KEEPALIVE gl() {
    
    // set size of viewport
    glViewport(0, 0, 800, 600);
    
}

int EMSCRIPTEN_KEEPALIVE main() {
    // insert code here...
    emscripten_log(EM_LOG_CONSOLE, "hello world \n");
    return 0;
};

}`

My terminal cmd :
main.cpp -Os -std=c++17 -s USE_WEBGL2=1 -o main.html

Thanks in advance for your help ;)

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