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
Calls to experiment.evaluate should not leak memory
Current Behavior
Calls to experiment.evaluate do leak memory
Possible Solution
The leak is in the interface between ruby and the kotlin evaluator. Note there is no call to dispose the returned string from evaluate. If you compare to the python version you can see a fix went in in October 2023 to fix what I expect is related to the problem in this ruby sdk. See bgiori's commit to fix the python side:
I am not familiar with ffi so was merely throwing darts.
Steps to Reproduce
The below reproduces on my mac. If you watch memory in ps/top/ActivityMonitor it will grow, for me starting at about 230mb to 500+mb. Note I print out the ruby memsize_of_all and that hardly moves. That implies its all on the native side.
Expected Behavior
Calls to experiment.evaluate should not leak memory
Current Behavior
Calls to experiment.evaluate do leak memory
Possible Solution
The leak is in the interface between ruby and the kotlin evaluator. Note there is no call to dispose the returned string from evaluate. If you compare to the python version you can see a fix went in in October 2023 to fix what I expect is related to the problem in this ruby sdk. See bgiori's commit to fix the python side:
amplitude/experiment-python-server@93c647f
I did some hacking of the ruby side to try and dispose the string and it seemed to help (?) but didn't solve:
I am not familiar with ffi so was merely throwing darts.
Steps to Reproduce
The below reproduces on my mac. If you watch memory in ps/top/ActivityMonitor it will grow, for me starting at about 230mb to 500+mb. Note I print out the ruby memsize_of_all and that hardly moves. That implies its all on the native side.
Environment
The text was updated successfully, but these errors were encountered: