-
Notifications
You must be signed in to change notification settings - Fork 111
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 while getting data from aerospike #520
Comments
Hi @smartist1401 I'll investigate this issue today and follow up with you soon. |
Would you mind sharing the script so I can debug it? |
Hi @juliannguyen4 |
Hey @smartist1401, I have found a few leaks from get() caused by several different sources. I'll try to fix them and will give you a status update by tomorrow at 5 PM PST. |
My notes about the get() leaks: There’s 2 sources for memory leaks with get():
I also added a breakpoint to check the reference counts of the record tuple’s objects as well as the reference count of the record tuple itself. None of them exceeded 1 when being returned by Using >>> import aerospike
>>> config = {"hosts": [("127.0.0.1", 3000)]}
>>> client = aerospike.client(config).connect()
>>> key = ("test", "demo", 1)
>>> client.put(key, {"a": 1})
0
>>> rec = client.get(key)
>>> import sys
>>> sys.getrefcount(rec)
2
>>> sys.getrefcount(rec[2])
2
>>> sys.getrefcount(rec[1])
2
>>> sys.getrefcount(rec[0])
2 |
@smartist1401 When you ran that script and saw the memory leaks reported by tracemalloc, did the records that were being queried exist on the server? |
Hey @smartist1401, I worked on fixing the memory leak today but I wasn't able to fully solve it. I'll let you know once I have found a solution |
Hi @juliannguyen4 some records exist and some other not. |
Got it. As I mentioned in my comment above, there's a memory leak from raise_exception(), which should be called when calling get() on a record that does not exist. I'll try to fix this memory leak and provide you with a build with the fix. |
Hi @juliannguyen4 |
I'm still getting to the bottom of it. |
Hi @juliannguyen4 |
Hi @juliannguyen4 |
I'm looking into it again now. I ran your script using Python client 11.0.1 and the memory leaks are still there. So this doesn't seem related to my memory leak fixes in 11.1.0. |
The
tracemalloc
pythonic tools shows that calling theget
function on theaerospike
client causes a memory leak.how I use the client
:I connect to the aerospike cluster by passing a list of hosts,
then in a loop (multiple iteration per second) I have multiple threads that simultaneously read some records from multiple sets.
The text was updated successfully, but these errors were encountered: