Reproducing procedure
Download tomcat (reproduced on 8.5.56)
In [tomcat root]/conf/tomcat-users.xml, create an admin with access to the manager panel:
<user username="admin" password="admin" roles="manager-gui"/>
(this allow to start and stop individual webapps, without a server restart)
Deploy a ZK webapp as a war file (reproduced with a new project created from maven archetype ZK EE webapp)
Run the server
Open the application's zul page (a client must have connected in order to trigger the issue)
Open the server's webapps manager (http://localhost:8080/manager/html)
use the "stop" button in the application list to stop the ZK webapp
Check server logs / console ([tomcat root]/catalina*.out)
Current Result
During DHTML Layout servlet operation, ThreadLocalsManager is used to store the pageDefinition in a threadlocal, but it's not cleaned up at the end of the transaction.
This cause a minor memory overhead, and trigger messages in tomcat such as:
lMapForLeaks The web application [zkdemo] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@35d75a7]) and a value of type [org.zkoss.zk.ui.metainfo.PageDefinition] (value [[PageDefinition: zkDemoContent, path=/WEB-INF/template/template_widget_demo.zul]]) 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.
Expected Result
Unused threadLocal objects should be released after the pageDefinition is no longer needed as a threadLocal value at the end of the page request.
Debug Information
Workaround
- relates to
-
ZK-3972 java.lang.NoClassDefFoundError: org/zkoss/zk/ui/util/forEachStatus caused by import Handler
- Closed