uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marshall Schor (JIRA)" <...@uima.apache.org>
Subject [jira] [Comment Edited] (UIMA-6058) Pear destroy does not destroy the resourceManagers
Date Fri, 14 Jun 2019 18:43:00 GMT

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

Marshall Schor edited comment on UIMA-6058 at 6/14/19 6:42 PM:
---------------------------------------------------------------

Rather than work on the mMetaDataList, perhaps a better thing is to let the garbage collector
collect the entire CasManager_impl.

The ResourceManager_impl has a reference to a CasManager_impl.  When the ResourceManger destroy()
method is called, it doesn't do anything to the referenced CasManager, because that instance
could be shared with other (non-destroyed) ResourceManagers.

But, if you know (in your particular application instance) when calling a ResourceManager
instance's destroy(), that the referenced CasManager is not shared, and won't be used again,
you could null out the reference:  e.g. my_resource_mgr.setCasManager(null);

This ought to allow the garbage collector to collect the CasManager (and therefore, it's mMetaDataList).

Would this method work for your use case?


was (Author: schor):
The ResourceManager_impl has a reference to a CasManager_impl.  When the ResourceManger destroy()
method is called, it doesn't do anything to the referenced CasManager, because that instance
could be shared with other (non-destroyed) ResourceManagers.

If, in your application, you know when calling a ResourceManager instance's destroy(), that
the referenced CasManager is not shared, and won't be used again, you could null out the reference: 
e.g. my_resource_mgr.setCasManager(null);

This ought to allow the garbage collector to collect the CasManager (and therefore, it's mMetaDataList).

Would this method work for your use case?

> Pear destroy does not destroy the resourceManagers
> --------------------------------------------------
>
>                 Key: UIMA-6058
>                 URL: https://issues.apache.org/jira/browse/UIMA-6058
>             Project: UIMA
>          Issue Type: Bug
>            Reporter: Matthias Koch
>            Priority: Major
>         Attachments: Screenshot_20190614_095220.png, UIMA-6058.diff
>
>
> the pear wrapper is caching resourceManagers which are not getting destroyed on destroy
of the pear wrapper.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message