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

Garbage collector cycle problem #34

Open
VinGarcia opened this issue Oct 6, 2016 · 1 comment
Open

Garbage collector cycle problem #34

VinGarcia opened this issue Oct 6, 2016 · 1 comment
Assignees
Labels

Comments

@VinGarcia
Copy link
Member

Currently we use a reference counting system for garbage collecting. I think it is specially efficient with the current architecture because we only need to manage the objects and lists, avoiding the worse part of the draw back of incrementing and decrementing the counter too often.

But there is still a problem to concern, namely the reference counting mechanism can not delete structures if they have cyclic reference among them, because it implies that each of them will always have ate least 1 reference, and thus can never be safely delocated.

We should think about how to fix it. I bet JavaScript uses reference counting since our engine seems to be very similar to theirs, and they have for sure found a solution. Another language I know uses reference counting is Python, and we could probably learn something from them as well.

@VinGarcia VinGarcia added the bug label Jan 13, 2017
@VinGarcia
Copy link
Member Author

VinGarcia commented May 9, 2017

Update: JavaScript uses mark & sweep, and Python uses Reference Counting + Mark & Sweep specialized for data cycles.

So we will need to implement a mark & sweep garbage collector at some point. Maybe we could use Python approach or at least leave this choice up to the user of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant