You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by "jbonofre (via GitHub)" <gi...@apache.org> on 2026/04/05 15:33:10 UTC

[PR] Remove static ThreadLocal caching in XmlUtils to prevent ClassLoader leaks [karaf]

jbonofre opened a new pull request, #2516:
URL: https://github.com/apache/karaf/pull/2516

   The static `ThreadLocal` fields holding `DocumentBuilderFactory`, `TransformerFactory` and `SAXParserFactory` pin the ClassLoader of the XML provider bundle on long-lived Karaf worker threads. When that bundle is updated or refreshed, the old ClassLoader can never be GC'd, causing zombie bundles and Metaspace growth.
   
   This patch removes the `ThreadLocal` caching and creates fresh factory instances per call. The public API is unchanged.
   
   Fixes #2278


-- 
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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove static ThreadLocal caching in XmlUtils to prevent ClassLoader leaks [karaf]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2516:
URL: https://github.com/apache/karaf/pull/2516#issuecomment-4189150103

   ## Test Results
   233 files  ±0  233 suites  ±0   21m 54s ⏱️ +2s
   917 tests ±0  869 ✅ ±0  48 💤 ±0  0 ❌ ±0 
   921 runs  ±0  873 ✅ ±0  48 💤 ±0  0 ❌ ±0 
   
   Results for commit 9160869c. ± Comparison against base commit 031d9a1b.
   
   [test-results]:data:application/gzip;base64,H4sIAPON0mkC/03Oyw7CIBCF4VdpWLtgACn4MgaHNiH2YrisGt/dkVRk+X+TnMzB5rBMid0GIeVlYKmE3KUv0eWwbwQgQZHQNX/vFsZf3VNBJDLa/ukZXkTKNJldWEh4gynGPZ4Sy1ZHBZzRNkfZpJus0C3W7gdxX9eQKZgFzekz1JyDfnBjEaQT6KS/Om+N89qYWSlk7w/YZULgDAEAAA==
   


-- 
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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove static ThreadLocal caching in XmlUtils to prevent ClassLoader leaks [karaf]

Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #2516:
URL: https://github.com/apache/karaf/pull/2516


-- 
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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org