In my Python code I use a third party shared object, a .so file, which I suspect to contains a memory leak. 
During the run of my program I have a loop where I repeatedly call functions of the shared object. While the programm is running I can see in htop, that the memory usage is steadily increasing. When the RAM is full, the programm crashes with the terminal output killed. My assumption is, that if the memory leak is produced by the shared object, because otherwise Python would raise an Exception.MemoryError.
I tried using reload(modul_name)  followed by a gc.collect() but it did not free the memory according to htop.
What shall I do?
 
     
     
    