-
Bug
-
Resolution: Done
-
Major
-
5.1.1.SP2
-
None
-
None
In ContainerLifecycleEventPreloader constructor, new ThreadGroup with hardcoded name is created each time the ContainerLifecycleEventPreloader instance is initialized. (The preloader can be initialized repeatedly for instance during application container reload.)
This creates a memory leak, although small in terms of memory, because created thread groups are never garbage collected. (There is a tree of created thread groups maintained in the ThreadGroup class which contains reference to every created group.)
public ContainerLifecycleEventPreloader(int threadPoolSize, ObserverNotifier notifier) { this.executor = Executors.newFixedThreadPool(threadPoolSize, new DaemonThreadFactory(new ThreadGroup("weld-preloaders"), "weld-preloader-")); this.notifier = notifier; }
Can the created thread group instance be kept in a static field to avoid it being created repeatedly?
- is cloned by
-
JBEAP-25714 (8.0.z) WELD-2755 Avoid creating duplicate thread groups
- Closed