Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential memory leak? #25

Closed
ColinEberhardt opened this issue Jan 28, 2021 · 2 comments
Closed

Potential memory leak? #25

ColinEberhardt opened this issue Jan 28, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ColinEberhardt
Copy link
Owner

I've been expanding the scope of the benchmark tests, most recently adding a more complex regex (https://github.com/ColinEberhardt/assemblyscript-regex/pull/24/files#diff-42e96713f3210182cc2ac65586ac4e2025e9c8134b31f88b2da3c2f69be5f452R65) to support evaluation of algorithm changes (e.g. NFA => DFA).

However, adding this more complex regex has caused an issue which looks like it could indicate a memory leak:

baseline x 106,495 ops/sec ±1.28% (85 runs sampled)
character class x 35,063 ops/sec ±1.28% (85 runs sampled)
concatenation x 7,934 ops/sec ±1.44% (87 runs sampled)
quantifiers x 14,392 ops/sec ±1.66% (86 runs sampled)
/home/runner/work/assemblyscript-regex/assemblyscript-regex/node_modules/@assemblyscript/loader/umd/index.js:78
      throw Error(`abort: ${getString(memory, msg)} at ${getString(memory, file)}:${line}:${colm}`);
      ^

Error: abort:  at ~lib/rt/tlsf.ts:238:14
    at abort (/home/runner/work/assemblyscript-regex/assemblyscript-regex/node_modules/@assemblyscript/loader/umd/index.js:78:13)
    at ~lib/rt/tlsf/insertBlock (<anonymous>:wasm-function[2]:0x689)
    at ~lib/rt/tlsf/addMemory (<anonymous>:wasm-function[3]:0x8d1)
    at ~lib/rt/tlsf/growMemory (<anonymous>:wasm-function[8]:0xbf6)
    at ~lib/rt/tlsf/allocateBlock (<anonymous>:wasm-function[10]:0xccb)
    at ~lib/rt/tlsf/moveBlock (<anonymous>:wasm-function[17]:0x1836)
    at ~lib/rt/tlsf/reallocateBlock (<anonymous>:wasm-function[18]:0x18ff)
    at ~lib/rt/tlsf/__realloc (<anonymous>:wasm-function[19]:0x1926)
    at ~lib/rt/pure/__renew (<anonymous>:wasm-function[20]:0x1958)
    at ~lib/array/ensureSize (<anonymous>:wasm-function[56]:0x2147)

see the PR: #24

@ColinEberhardt ColinEberhardt added the bug Something isn't working label Jan 28, 2021
@jtenner
Copy link

jtenner commented Feb 21, 2021

Hey. What's the status on this? Did the new runtime help with this problem?

@ColinEberhardt
Copy link
Owner Author

Good point, yes it did. With the new 0.18 runtime the performance is improved and also I’ve been able to add some more complex regex tests to the benchmark 12c8e55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants