Re: [mongodb-user] Mongo application fails to stop thread MongoCleaner with redeploy or restart Tomcat

2,768 views
Skip to first unread message

Scott Hernandez

unread,
Jun 28, 2012, 8:58:43 AM6/28/12
to mongod...@googlegroups.com
What is your tomcat version/config? How are restarting/redeploying?

On Thu, Jun 28, 2012 at 7:58 AM, grtvrt <gert.v...@gmail.com> wrote:
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.

Can someone give me some clues of what's going on here. Is there something else I have missed? Couldn't find anything usefully with an internetsearch... Time to ask the experts.

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

grtvrt

unread,
Jul 2, 2012, 3:36:39 AM7/2/12
to mongod...@googlegroups.com
Hi Scott,

Thanks for looking into this. I'm using Tomcat-7.0.19. I'm deploying with the maven-tomcat-plugin. But  I get the same error with a hot-deploy from within eclipse or by restarting/shutdown of Tomcat . Mongo is a singleton which is instantiated   by Spring. 





Op donderdag 28 juni 2012 14:58:43 UTC+2 schreef Scott Hernandez het volgende:

See also the IRC channel -- freenode.net#mongodb


Op donderdag 28 juni 2012 14:58:43 UTC+2 schreef Scott Hernandez het volgende:

See also the IRC channel -- freenode.net#mongodb


Op donderdag 28 juni 2012 14:58:43 UTC+2 schreef Scott Hernandez het volgende:

Scott Hernandez

unread,
Jul 2, 2012, 6:49:23 AM7/2/12
to mongod...@googlegroups.com
Can you run a debugger, or write some code to verify that there aren't multiple instances, because I've seen spring environments where the configuration believed to be correct did not ensure it was actually a singleton.

Since your setup is not trivial and there are many options which could be affecting the config can you provide a simple reproduction case someone can run and debug? It is probably best to file this as a java jira issue since it will require reproducing it with whatever you provide: http://jira.mongodb.org/browse/JAVA/

grtvrt

unread,
Jul 3, 2012, 5:59:22 AM7/3/12
to mongod...@googlegroups.com
Hi Scott,

I created an issue here, https://jira.mongodb.org/browse/JAVA-595 . I have made a simple webapp without Spring interference. This solved the error message on shutting down. However the error message still appears on a redeploy, though it's slightly  different. It says now:

SEVERE: The web application [/MongoReporter] created a ThreadLocal with key of type [com.mongodb.DBTCPConnector$1] (value[com.mongodb.DBTCPConnector$1@6c747b55]) and a value of type [com.mongodb.DBTCPConnector.MyPort] (value[com.mongodb.DBTCPConnector$MyPort@534d4113]) 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. (.. more or less the same)

Hope for the best,

Gert

Maruthi Shanmugam

unread,
Oct 5, 2012, 4:37:19 AM10/5/12
to mongod...@googlegroups.com
Hi ,
Is there a solution for this issue.. I mean Gert , if you can share your code snippet for resolution it would be great (w.r.to spring context).

See also the IRC channel -- freenode.net#mongodb

Op donderdag 28 juni 2012 14:58:43 UTC+2 schreef Scott Hernandez het volgende:
What is your tomcat version/config? How are restarting/redeploying?

On Thu, Jun 28, 2012 at 7:58 AM, grtvrt <gert.v...@gmail.com> wrote:
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.

Can someone give me some clues of what's going on here. Is there something else I have missed? Couldn't find anything usefully with an internetsearch... Time to ask the experts.


--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to

See also the IRC channel -- freenode.net#mongodb
Op donderdag 28 juni 2012 14:58:43 UTC+2 schreef Scott Hernandez het volgende:
What is your tomcat version/config? How are restarting/redeploying?

On Thu, Jun 28, 2012 at 7:58 AM, grtvrt <gert.v...@gmail.com> wrote:
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.

Can someone give me some clues of what's going on here. Is there something else I have missed? Couldn't find anything usefully with an internetsearch... Time to ask the experts.


--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to

See also the IRC channel -- freenode.net#mongodb

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to

grtvrt

unread,
Oct 8, 2012, 3:23:53 PM10/8/12
to mongod...@googlegroups.com
Hi,

Sorry, but I never found a solution to this problem. I reported this to jira.mongodb.org and have been waiting patiently... for 3 months now.. I hope they will fix this one time. In the meantime I have taken the my application into production and actually never run into problems, because of this issue. But it's very irritating problem when you're developing, the frequent restarts of the Tomcat server causes rapidly a OutOfMemory:Permgen space error

Gert 

Abby Millward

unread,
Oct 11, 2013, 12:07:45 AM10/11/13
to mongod...@googlegroups.com
Any news on this? I am having the same issue.

Stephen Steneker

unread,
Oct 11, 2013, 12:17:11 AM10/11/13
to mongod...@googlegroups.com
On Friday, October 11, 2013 3:07:45 PM UTC+11, Abby Millward wrote:
Any news on this? I am having the same issue.

Hi Abby,

If you are definitely having the same issue as the original discussion thread (which is well over a year old), you can find more information on the Java driver ticket where this was reported:

According to JAVA-595, this was resolved as at the Java driver 2.11.0 release.

In general it is best to start a new thread including details specific to your issue such as the Java driver version, MongoDB version, and any relevant logs or information to help reproduce the issue.

Regards,
Stephen

Fabian Rossbacher

unread,
Nov 18, 2013, 9:40:25 AM11/18/13
to mongod...@googlegroups.com
we have the same issue on tomcat6 an spring 

<spring.version>2.0.7</spring.version>

mongo:

<dependency>

<groupId>org.springframework.data</groupId>

<artifactId>spring-data-mongodb</artifactId>

<version>1.2.1.RELEASE</version>

</dependency>

Reply all
Reply to author
Forward
Message has been deleted
0 new messages