I have an issue with my application based on spring-data-mongodb (101 release) and I use the mongo-java-driver 2.8.0.
When restarting Tomcat I get this message:
SEVERE: The web application [/sky-rest-provider] appears to have started a thread named [MongoCleaner1055191651] but has failed to stop it. This is very likely to create a memory leak.
When redeploying i get this message:
SEVERE: The web application [/sky-rest-provider] created a ThreadLocal with key of type [com.mongodb.DBTCPConnector$1] (value [com.mongodb.DBTCPConnector$1@346f76f9]) and a value of type [com.mongodb.DBTCPConnector.MyPort] (value [com.mongodb.DBTCPConnector$MyPort@543efe7e]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
and indeed after a few redeploys I run into OutOfMemory:Permgen space error. I thought this was fixed in version 2.6, see link: https://jira.mongodb.org/browse/JAVA-306.
Is there something else I have missed? Couldn't find anything usefully with an internetsearch... Time to ask the experts.
This is my spring config for mongo
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongo" ref="mongo" />
<constructor-arg name="databaseName" value="CLOUD" />
<!-- Factory bean that creates the Mongo instance -->
<bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean">
<property name="host" value="localhost" />