-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.10.1
-
Component/s: Connection Management
-
None
-
Environment:Java
We are seeing thread local data being left on threads in the thread
pool of our application running in Tomcat 7 causing a memory leak.
This problem is not unique to us. The JIRA issues below are described
by your customers experiencing similar problems
https://jira.mongodb.org/browse/JAVA-596
https://jira.mongodb.org/browse/JAVA-130
https://jira.mongodb.org/browse/JAVA-236
In JAVA-236, the issue is closed but it does not address the issue.
The patch seems to miss the point: we want to free the TLS, not close
the connection.
Here is the patch we have introduced to your 2.9.10 distribution:
— src/main/com/mongodb/DBTCPConnector.java.orig 2012-12-03
12:39:49.000000000 -0700
+++ src/main/com/mongodb/DBTCPConnector.java 2012-12-11
08:04:11.000000000 -0700
@@ -608,6 +608,15 @@
}
/**
+ * Release thread local storage for invoking thread. This should
be called for threads
+ * in thread pools implemented as part of a web framework per
request. It is not required
+ * for the thread invoking close().
+ */
+ public void release()
+
+ /**
- duplicates
-
JAVA-595 With redeploy web app created a ThreadLocal but failed to remove it when the web application was stopped
- Closed