-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 leak in get_item_vector() ? #124
Comments
does it eventually run out of memory and crash? i'm guessing it's just on the python side that the interpreter allocates memory. maybe it doesn't collect it until needed |
@erikbern I did not really wait until it crashed in my actual application, as I was running it in a shared server. But the memory usage was maxed out and the server started swapping heavily. |
I think I've been able to repro is using this: class MemoryLeakTest(TestCase):
def test_get_item_vector(self):
f = 10
i = AnnoyIndex(f, 'euclidean')
i.add_item(0, [random.gauss(0, 1) for x in xrange(f)])
for j in xrange(100 * 1000 * 1000):
i.get_item_vector(0) |
great if you can take a look again |
I will check again next week, thanks for the quick response and HAPPY NEW YEAR #offtopic |
oh, it is fixed, thanks (and sorry for taking this long to confirm) |
np (just published 1.7.0 to pypi with this fix in it) |
I don't really know how to diagnose memory leak, however I do notice memory usage keep increasing when calling
get_item_vector
repetitively.However, the memory problem is gone if I do a
gc.collect()
after each call toget_item_vector
does that help?My installation of annoy
Using python 3.4 on Ubuntu 14.04 64bit
The text was updated successfully, but these errors were encountered: