Skip to content

Try memory leak workaround with zeroed mem - #1229

Merged
adamziel merged 4 commits into
trunkfrom
re-add-mem-leak-workaround
Apr 11, 2024
Merged

Try memory leak workaround with zeroed mem#1229
adamziel merged 4 commits into
trunkfrom
re-add-mem-leak-workaround

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Apr 11, 2024

Copy link
Copy Markdown
Member

What is this PR doing?

This PR attempts to fix the memory leak reported in #1128 and is an iteration on PR #1189 which had problems with "memory out of bounds" errors.

What problem is it solving?

It stops PHP from leaking memory throughout the runtime of a script and hopefully stops memory out of bounds errors by zeroing all memory given to PHP.

How is the problem addressed?

  • By avoiding mmap()/munmap() which have incomplete implementations in Emscripten
  • By using posix_memalign() to allocate memory instead and manually zeroing the memory before handing it to PHP

Testing Instructions

  • Observe CI test results
  • Use npm run dev and exercise Playground locally in the browser
@brandonpayton
brandonpayton requested a review from a team April 11, 2024 12:39
@adamziel
adamziel merged commit e36e1b9 into trunk Apr 11, 2024
@adamziel
adamziel deleted the re-add-mem-leak-workaround branch April 11, 2024 13:38
@sejas

sejas commented Apr 12, 2024

Copy link
Copy Markdown
Collaborator

@brandonpayton , Huge thanks for fixing this! It works great on NodeJS ❤️

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

Labels

None yet

3 participants