lukaszlenart opened a new pull request, #1631:
URL: https://github.com/apache/struts/pull/1631

   ## Summary
   
   - Fixes classloader/memory leaks that cause `OutOfMemoryError` (Metaspace) 
during Tomcat hot redeployment 
([WW-5537](https://issues.apache.org/jira/browse/WW-5537))
   - Introduces `InternalDestroyable` interface with container-based discovery 
so static caches, daemon threads, and shared references are cleaned up when 
`Dispatcher.cleanup()` runs
   - Clears OGNL, Component, ScopeInterceptor, DefaultFileManager, FreeMarker, 
and JSON plugin caches; stops the `FinalizableReferenceQueue` daemon thread; 
replaces `ContainerHolder` `ThreadLocal` with `volatile`
   
   ## Changes
   
   | Area | What |
   |------|------|
   | Core | `InternalDestroyable` / `ContextAwareDestroyable` interfaces |
   | Core | `ComponentCacheDestroyable`, `OgnlCacheDestroyable`, 
`ScopeInterceptorCacheDestroyable`, `FinalizableReferenceQueueDestroyable`, 
`FreemarkerCacheDestroyable` |
   | Core | `ContainerHolder` ThreadLocal → volatile |
   | Core | `Dispatcher.cleanup()` refactored into focused destroy methods |
   | JSON plugin | `JSONCacheDestroyable` registered in `struts-plugin.xml` |
   | Tests | `DispatcherCleanupLeakTest` (8 tests), 
`FinalizableReferenceQueueTest` |
   
   ## Test plan
   
   - [x] `DispatcherCleanupLeakTest` — verifies each static cache is cleared 
after `dispatcher.cleanup()`
   - [x] `FinalizableReferenceQueueTest` — verifies daemon thread stops and 
singleton is nulled
   - [ ] Manual verification: deploy HelloWorld WAR on Tomcat 9, redeploy 5+ 
times, confirm no Metaspace growth via `jmap`/MAT
   - [ ] Run full CI suite
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to