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 collection for functionClass objects #119

Open
abensonca opened this issue Mar 16, 2020 · 1 comment
Open

Garbage collection for functionClass objects #119

abensonca opened this issue Mar 16, 2020 · 1 comment

Comments

@abensonca
Copy link
Collaborator

abensonca commented Mar 16, 2020

Currently reference counting is used for functionClass object memory management. But this fails since we can have reference loops. We currently work around this using a complicated system of recursiveSelf pointers. A garbage collecting approach, perhaps added on top of the reference counting approach, would fix this.

Garbage collection could be triggered manually, e.g. on each MCMC iteration.

Need to keep a list of all allocated functionClass objects. On garbage collection, walk entire tree of objects starting from root(s), marking them as found. Any not marked can then be deallocated.

@abensonca
Copy link
Collaborator Author

A better option might be to allow "weak referenced" in parts of a circular reference which do not prevent garbage collection.

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

No branches or pull requests

1 participant