tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Rosenberg <>
Subject How to start a daemon without getting the warning?
Date Wed, 27 Oct 2010 20:10:36 GMT

I'm getting following warning with 6.0.29,

after shutdown:
SEVERE: The web application [/moskitodemo] appears to have started a
thread named [MoskitoMemoryPoolReader] but has failed to stop it. This
is very likely to create a memory leak.

here's the snapshot of the code that starts the thread:

public class BuiltInMemoryPoolProducer implements IStatsProducer{

	 * Timer instance for this producer type.
	private static final Timer timer = new Timer("MoskitoMemoryPoolReader", true);


	public BuiltInMemoryPoolProducer(MemoryPoolMXBean aPool){

		timer.scheduleAtFixedRate(new TimerTask() {
			public void run() {
		}, 0, 1000L*60);

to my knowledge this thread is a daemon. This knowledge is also shared
by jstack:

"MoskitoMemoryPoolReader" daemon prio=5 tid=10883f800 nid=0x11a9b2000
in Object.wait() [11a9b1000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <10a1120d0> (a java.util.TaskQueue)
	at java.util.TimerThread.mainLoop(
	- locked <10a1120d0> (a java.util.TaskQueue)

So, how can I avoid this warning and where's the bug.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message