paranim / pararules

A Nim rules engine
The Unlicense
139 stars 3 forks source link

Memory leaks #9

Open ul opened 1 year ago

ul commented 1 year ago

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

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

ul commented 1 year ago

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

oakes commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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