Original post

Hi guys I have a microservice that does a simple mysql query, do some transformation and store the results. I can create an example if you want, but it’s really simple. The point is that after a couple of hours it starts leaking memory and I don’t know why, it is something like this:

func main(){ for { doMysqlStuff() time.sleep(time.Second * value) } } 

No global variables, no stored results between doMysqlStuff() executions. I can only think that the mysql driver itself is creating global variables that aren’t specified on the documentation. Every connection (there’s only one, no pool used) has it’s defer close()…

submitted by /u/scp-NUMBERNOTFOUND
[link] [comments]