You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Andrey Davydov (Jira)" <ji...@apache.org> on 2020/03/18 17:05:00 UTC

[jira] [Comment Edited] (FELIX-6243) Link to root Felix object leaks to GC root

    [ https://issues.apache.org/jira/browse/FELIX-6243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061913#comment-17061913 ] 

Andrey Davydov edited comment on FELIX-6243 at 3/18/20, 5:04 PM:
-----------------------------------------------------------------

as I understand during tests, problem is actual when MSSQL jdbc drivers run inside my custom bundle. For all other bundles in our app everything works fine. So it is my problem.

But I think, that reafactor ThreadFactory from nested to outer class is good idea anyway and it will be good to shutdown ThreadPool Executor during Felix stop. It make Felix collectable 60 seconds early, it is good for test routines, when felix start/stop repeatedly for every test.

 

 

 


was (Author: andrey.davydov):
as I understand during tests, problem is actual when MSSQL jdbc drivers run inside my custom bundle. For all other bundles in our app everything works fine.

But I think, that reafactor ThreadFactory from nested to outer class is good idea anyway and it will be good to shutdown ThreadPool Executor during Felix stop. It make Felix collectable 60 seconds early, it is good for test routines, when felix start/stop repeatedly for every test.

 

 

 

> Link to root Felix object leaks to GC root
> ------------------------------------------
>
>                 Key: FELIX-6243
>                 URL: https://issues.apache.org/jira/browse/FELIX-6243
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: framework-6.0.3
>            Reporter: Andrey Davydov
>            Priority: Major
>         Attachments: felix.png
>
>
> Tested on java8.
> Felix object creates StatefulResolver and then  StatefulResolver  get link to Felix. 
> StatefulResolver creates Executor in getExecutor() using nested class as ThreadFactory (when FelixConstants.RESOLVER_PARALLELISM greater then 1)
>  
> So every thread in Executor has link to Executor
> Executor has link to ThreadFactory
> ThreadFactory has link to StatefulResolver, because it is nested
> StatefulResolver has link to Felix
>  
> And it is the way from GC root to Felix and GC can't collect Felix after Felix.stop() and all external refs to Felix cut.
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)