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

Try memory leak workaround with zeroed mem #1229

Merged
merged 4 commits into from
Apr 11, 2024
Merged

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
4 of 5 checks passed
@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.

None yet

3 participants