Java MySQL JDBC Memory Leak

前端 未结 4 1599
死守一世寂寞
死守一世寂寞 2020-12-08 23:13

Ok, so I have this program with many (~300) threads, each of which communicates with a central database. I create a global connection to the DB, and then each thread goes ab

4条回答
  •  不知归路
    2020-12-08 23:35

    Once upon a time, whenever my code saw "server went away," it opened a new DB connection. If the error happened in the right (wrong!) place, I was left with some non-free()d orphan memory hanging around. Could something like this account for what you are seeing? How are you handling errors?

提交回复
热议问题