Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a new connection only if needed. Creating too many connection is causing too many threads to be created. This reduces the memory leak significantly but is not the sole reason for the memory leak.