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

fix!: Rework memory management #461

Merged
merged 1 commit into from
Dec 12, 2020
Merged

fix!: Rework memory management #461

merged 1 commit into from
Dec 12, 2020

Conversation

ospencer
Copy link
Member

This PR addresses some issues we've been having working with large data sets.

Major changes: Grain will now properly grow the WebAssembly memory when out of space. Additionally, a majority of the memory manager has been rewritten from JS into AssemblyScript (which aligns with our goal of removing our dependency on JS).

Minor change: Removed support for garbage collection of cyclic data structures as it caused a major slowdown when trying to reclaim memory from data structures with many children. Grain doesn't (yet) have first-class support for cyclic data structures (see #96), so we don't believe this is a huge issue. If it does become an issue before WebAssembly has its own GC, we'll implement some variation of weak refs.

This is technically a breaking change because GrainRunner is no longer exported from the runtime. None of our tooling interacts with it directly, though.

@ospencer ospencer requested a review from a team December 11, 2020 23:27
@ospencer ospencer self-assigned this Dec 11, 2020
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this against all my Advent of Code stuff and it all works great! Truly amazing work @ospencer - I owe you a 🥃 !!!!!!!

@ospencer
Copy link
Member Author

I will definitely take a 🥃 any day of the week.

I also feel like I really need a 🥃 after the debugging to get this working 😂

@ospencer ospencer merged commit 89a2aa8 into master Dec 12, 2020
@ospencer ospencer deleted the fix-allocator branch December 12, 2020 00:08
ospencer added a commit that referenced this pull request Jan 11, 2021
ospencer added a commit that referenced this pull request Jan 16, 2021
ospencer added a commit that referenced this pull request Jan 16, 2021
ospencer added a commit that referenced this pull request Jan 16, 2021
ospencer added a commit that referenced this pull request Jan 16, 2021
@github-actions github-actions bot mentioned this pull request Apr 20, 2021
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.

2 participants