You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo is good work, thanks for providing a valuable resource for tracking researchers!
I noticed you are using lru_cache for instance methods in the repo, e.g. in updater.kalman.KalmanUpdater.predict_measurement. It has been noted that this can cause memory leaks due to cyclic dependency in the garbage collection (the cache never releases reference to the instance).
In my own code, I've worked around this by implementing a plain function (or static method) that is lru_cached and then redirecting the instance method to it. Some alternative solutions are provided at the above post. (I see you've used the staticmethod technique in some places as well).
Don't know if you have actually encountered issues with this in practice, but I thought I'd bring it up.
-Ben Davis
The text was updated successfully, but these errors were encountered:
Thanks for raising this @bpdavis86. It is something we were aware of, but as we don't create many Predictor or Updater objects, shouldn't really be an issue. I think looking at a per instance cache solution is probably best.
This repo is good work, thanks for providing a valuable resource for tracking researchers!
I noticed you are using lru_cache for instance methods in the repo, e.g. in updater.kalman.KalmanUpdater.predict_measurement. It has been noted that this can cause memory leaks due to cyclic dependency in the garbage collection (the cache never releases reference to the instance).
https://stackoverflow.com/questions/33672412/python-functools-lru-cache-with-instance-methods-release-object
In my own code, I've worked around this by implementing a plain function (or static method) that is lru_cached and then redirecting the instance method to it. Some alternative solutions are provided at the above post. (I see you've used the staticmethod technique in some places as well).
Don't know if you have actually encountered issues with this in practice, but I thought I'd bring it up.
-Ben Davis
The text was updated successfully, but these errors were encountered: