trolldbois / adns-python

Automatically exported from code.google.com/p/adns-python
0 stars 0 forks source link

adns module memory leak? #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've been using your adns python module for some long-running processes
that do a lot of DNS lookups (several million per day).  When doing NS
record lookups, I ran into a memory leak issue -- after a couple days the
processes would be eating GBs of RAM.  It looks like the same problem
affects lookups whenever you wish to retrieve the records in the
"additional" section of the response (such as the IP addresses
associated
with the NS/MX records).  After a bit of digging, I noticed that the module
was leaking huge numbers of tuples... the following simple patch seems to
do the trick:

--- adnsmodule.c.orig   Sat Jan 29 13:12:06 2005
+++ adnsmodule.c        Wed Aug 30 18:50:27 2006
@@ -174,6 +174,7 @@
        }
        o = Py_BuildValue("siO", hostaddr->host,
hostaddr->astatus,
                          addrs);
+       Py_DECREF(addrs);
        return o;
 }

If you don't see a problem with this, inclusion in the next release
(assuming there will be one) would be most convenient.  Thanks!

Originally submitted by andrew@flury.org

Original issue reported on code.google.com by farcep...@gmail.com on 2 Dec 2006 at 5:51

GoogleCodeExporter commented 8 years ago
Fixed in trunk r5.

Original comment by farcep...@gmail.com on 2 Dec 2006 at 6:05