the MySQLStatement does start a TimerThread to handle the timeouts (which are e.g. applied in transactions).
Stopping the webapplication does leak those thread because it is never stopped and the complete classloader fails to get garbage collected.
My current workaround is, to call this in the contextDestroyed method of a webapp listener:
I've done similar for mysql, to stop the scheduler started to destroy connections.
The difference is that there is an api call, a static method shutdown, to do this and i need no hacks to get that timer variable.
Maybe you can implement similar.
And if you do so, it would be nice if you can call the constructor, which does take a name for the Timer, e.g. MariaDBTimeoutStatementTimer, or something like this, to get rid of the "Timer-0" name in the thread overview to know what "Timer-0" is about for.
JDK 1.7.x, Tomcat 7.0.42