Skip to content

tlsf allocator cannot grow its memory #548

Closed
@DieMyst

Description

@DieMyst

I reproduced it in a fork of json parser example:
https://github.com/fluencelabs/assemblyscript-json

to check bug run npm run test

Memory is initialized in helpers.ts as new WebAssembly.Memory({ initial: 2, maximum: 1000 }.
In roundtrip.spec.as.ts JSON is serialized-deserialized 500 times.
This parser is leaking, so the memory size grows with each iteration and the program will throw an exception:

  Error {
    message: 'Abort called at ~lib/allocator/tlsf.ts [483:2]',
  }

There will be no exceptions if increase initial memory pages or change allocator to buddy or arena.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions