Skip to content

Conversation

brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Apr 11, 2024

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
Copy link
Collaborator

sejas commented Apr 12, 2024

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants