15.1 Notes on using the thread-local variables

If you do not delete the class instances of the J2EE application stored in the thread-local variable until the J2EE application stops, a memory leak occurs because the class loader references remain behind even after you stop the J2EE application.

Use the java.lang.ThreadLocal.remove() method to delete the class instances of the J2EE application stored in the thread-local variable.

If you cannot delete the instances in which the items such as the framework are stored in a J2EE application, do not start and stop the J2EE application repeatedly. To start and stop a J2EE application repeatedly, restart the J2EE server.