-
Notifications
You must be signed in to change notification settings - Fork 388
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
[gno] synchronous garbage collection #266
Milestone
Comments
Merged
jaekwon
changed the title
GNO2: synchronous garbage collection
[gno] synchronous garbage collection
Jan 5, 2023
clearing this just so anyone ambitious and familiar with the gno VM can try their hand at implementing. |
moul
moved this from 🚀 Needed for Launch
to 🌟 Wanted for Launch
in 🚀 The Launch [DEPRECATED]
Oct 27, 2023
Closed
Open
Closed
Closed
Kouteki
added
📦 🤖 gnovm
Issues or PRs gnovm related
in focus
Core team is prioritizing this work
labels
Nov 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the memory allocator doesn't account for any GC freed objects.
That is, objects like large strings or arrays each count against the allocation limit, even for temporary objects that get thrown away after the scope of the function call.
For example, the above variable x returned is 100 bytes long, but all the prior subsequent strings were also accounted for, from x length 1, 2, 3, .. to length 100. Even though all prior x's become garbage collected, gno's memory management is not yet that smart.
This is a feature request issue to add some kind of synchronous garbage collection mechanism to free up GC'd memory. This could happen between realm function call boundaries, or it could happen with some special system function call. Or maybe this is best solved with function comment directives.
update
Garbage collection can be implemented synchronously upon memory alloc failure (before it returns failure) to scan all stack and block local variables to see what is still alive (and then decrement the total allocated number accordingly).
Two points:
The text was updated successfully, but these errors were encountered: