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
Actors are not released by GC after proper termination #495
Comments
Can you post a reproduction of the problem? There are clearly a number of long-running Celluloid programs that don't have this problem |
Here's a test case: https://gist.github.com/niamster/9f8dc8fb510164fbbc9c |
Looks like you're right. I have absolutely no idea what could be holding a reference. I looked through the entire thread pool and there's nothing holding a reference in a thread local. |
It looks like there's a circular reference. Though I could not find it yet =/ |
A circular reference should be handled properly by a mark/sweep GC |
Yes, you are right. I've did a simple test and class instance is properly removed by GC whether it has instance variable that holds reference to self whether it has variable of class instance that holds reference to "self". |
In fact it has the same root cause as #463 and is the latter has more activity I'm closing this issue as a duplicate. |
After calling actor.terminate the actual actor instance(and all the proxies, cells, etc) are still floating even after explicit call to ruby GC.
I've tried to find all the references and clean up manually but it still was not sufficient.
Obviously I'm missing smth. After few tricks, ruby-mass did not show any references to the actor instance(which is CellProxy instance) though the instance was still floating(seen in Mass.index Test).
Probably that is because of some Celluloid tricks caused a circular dependency somewhere ...
To ensure that the instance is GC'ed I've added following finalizer:
This is a problem for a long running server apps(DCell for example).
Configuration: celluloid v0.16, ruby 2.2.0, x86-64 linux
The text was updated successfully, but these errors were encountered: