So, while fixing that memory leak, I noticed that in the last 10 days
there have been 260,000 connects (and 260,000 disconnects) to the mysqld server. 240,000 of them were from the TMCD! I've changed the DB code to keep the connection to the server open, and let the server time it out. The client side code library code already deals with a auto reconnect if the server goes away, so no reason to open/close this connection for every single DB query. Besides, it might help reduce the amount of time it takes to answer a single tmcd query, and that would be a good thing.