Share

HyperSQL Database Engine

Tracker: Bugs

5 HsqlTimer.TaskRunner thread must nullify contextClassLoader - ID: 1922315
Last Update: Settings changed ( fredt )

Upon shutdown, the HsqlTimer.TaskRunner needs to nullify the thread
"taskRunnerThread" contextClassLoader property via a
setContextClassloader(null) on shutdown()

By not doing this, if hsql is used in a hot-deployed environment, such as
in Tomcat. When the context is destroyed and if shutdown() is called on the
database, this thread retains a reference to the WebappClassloader, which
will never be cleaned up out of the heap because a JVM thread group retains
a reference to this thread. Over time this will lead to a permgen out of
memory exception

[jvm thread group] -> [hsqltimer.taskRunner thread].contextClassLoader ->
WebappClassloader -> [entire application]


interz12 ( interz12 ) - 2008-03-21 16:02

5

Closed

Fixed

Nobody/Anonymous

engine

current-release

Public


Comments ( 4 )

Date: 2009-09-15 00:40
Sender: fredtProject Admin

Has been applied to both 1.8 and 1.9


Date: 2008-03-21 20:23
Sender: interz12


Also interrupt() the Thread to release it's target


Date: 2008-03-21 20:23
Sender: interz12


File Added: HsqlThreadFactory.java


Date: 2008-03-21 17:35
Sender: interz12


Attached a patch for HsqlThreadFactory from 1.8.05

It keeps tracks of all threads created, but then simply allows someone to
call shutdownAllThreads() if they choose to do so.
File Added: HsqlThreadFactory.java


Attached File ( 1 )

Filename Description Download
HsqlThreadFactory.java Download

Changes ( 7 )

Field Old Value Date By
status_id Open 2009-09-15 00:40 fredt
close_date - 2009-09-15 00:40 fredt
allow_comments 1 2009-09-15 00:40 fredt
resolution_id None 2009-09-15 00:40 fredt
File Added 271355: HsqlThreadFactory.java 2008-03-21 20:23 interz12
File Deleted 271340: 2008-03-21 20:22 interz12
File Added 271340: HsqlThreadFactory.java 2008-03-21 17:35 interz12