aerospike-client-python: Memory Leak while getting data from aerospike

The tracemalloc pythonic tools shows that calling the get function on the aerospike 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.

Screenshot 2023-09-25 093254

Screenshot 2023-09-25 093756

About this issue

Most upvoted comments

Hi @juliannguyen4 Recently, the new version 14.0.0 has been released. Has the memory leak problem been fixed in this version?

I’m still getting to the bottom of it.

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.

@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?

Hi @juliannguyen4 Thanks for the investigation I get a record by key in a try section and return the record if exist, in except (not found record exception) I return an empty dict in except section.

some records exist and some other not.