[ https://issues.apache.org/jira/browse/KARAF-6792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Onofré updated KARAF-6792: ---------------------------------------- Fix Version/s: (was: 4.3.1) (was: 4.2.11) > Memory leak when restarting bundle with service bound to a command > ------------------------------------------------------------------ > > Key: KARAF-6792 > URL: https://issues.apache.org/jira/browse/KARAF-6792 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.2.8 > Environment: Karaf 4.2.8 > openjdk 11.0.7 2020-04-14 > Reporter: ggirard07 > Assignee: Jean-Baptiste Onofré > Priority: Major > Attachments: image-2020-07-17-11-21-21-301.png, > image-2020-07-17-11-23-00-615.png > > > Code to reproduce the issue available at > [https://github.com/ggirard07/karaf-command-service-leak] > When restarting a bundle containing a command with a bound service with > @Reference annotation, the previous service instance is being leaked because > the command instance keep the object alive. > Trying to reproduce the issue might take multiple restarts as the > reproduction sample seems to be leaking at a frequency of 2/3 based on my > testing. > *Steps to reproduce* > # Install the bundle built from reproduction sample > # Inspect MyServiceImpl instances in VisualVM > # Restart the bundle with bundle:restart bundleId > # Inspect MyServiceImpl instances in VisualVM > *Expected result* > A single instance of the MyServiceImpl singleton exist at all time. > *Actual result* > The old MyServiceImpl instance is leaked and 2 instances of the service > singleton coexists. > !image-2020-07-17-11-23-00-615.png! -- This message was sent by Atlassian Jira (v8.3.4#803005)