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

Memory leaks #9

Open
ul opened this issue Jan 17, 2023 · 4 comments
Open

Memory leaks #9

ul opened this issue Jan 17, 2023 · 4 comments

Comments

@ul
Copy link
Contributor

ul commented Jan 17, 2023

When using pararules in my project, I noticed two kinds of memory leaks:

  • Cows leak memory on each fireRules.
  • Independent of that, it seems that retracting facts doesn't decrease the network's memory consumption, and the network grows relatively big for a modest number of rules and facts.

I'll fix the first as I introduced the cow solution, but I'm unsure what to do with the second.

@ul
Copy link
Contributor Author

ul commented Jan 18, 2023

Actually, I struggle to find why CowTable is leaking memory =(

@oakes
Copy link
Member

oakes commented Jan 18, 2023

Hmm yeah I can definitely see the leak. How about I revert for now and you submit a new PR if/when you find the leak?

@ul
Copy link
Contributor Author

ul commented Jan 18, 2023

Solved with switching to the ptr and manual memory management.

This leaves us with garbage collection for the network itself. It grows when I add facts but never shrinks, independent of using CowTable or Table.

@oakes
Copy link
Member

oakes commented Jan 18, 2023

Still leaking for me but I'll make a new release with the revert and we can take our time finding a fix. It's all good -- neither of us noticed :D

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

No branches or pull requests

2 participants