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

cyclic reference can occuring memory leak in chainState struct #43

Open
Rhyanz46 opened this issue Sep 21, 2024 · 0 comments
Open

cyclic reference can occuring memory leak in chainState struct #43

Rhyanz46 opened this issue Sep 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Rhyanz46
Copy link
Owner

Rhyanz46 commented Sep 21, 2024

type chainState struct {

Here, parent refers to child, and child refers back to parent. This creates circular references that can cause memory leaks, because the garbage collector in Go will not be able to detect that the object is actually no longer used.

Maybe it won't happen, but right now I'm still researching

if it's real maybe the solution is :

  • Weak References
  • stopping reference manually when no needed
  • change structure to traversal graph
  • using Runtime Finalizer
@Rhyanz46 Rhyanz46 added the bug Something isn't working label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant