[
https://issues.apache.org/jira/browse/UIMA-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16522797#comment-16522797
]
Marshall Schor commented on UIMA-5801:
--------------------------------------
OK, found a root cause, but need to discuss how to do fix. I was able to get
constant performance by resetting the hashmap at JCas reset that holds maps
from classloaders to JCasHashMaps.
The JCas keeps maps from classLoaders to JCasHashMaps (which associated the
primitive CAS Feature Structures with Java cover Objects).
uimaFIT appears to create new classLoaders for each analysis Engine it makes.
The same JCas is used with all of these engines, hence the map from
classloaders to JCasHashMaps grows larger over time in this test case.
One possible "fix" is to have the CAS Reset drop all the JCasHashMaps for other
class loaders. I think this could work, but might have some performance impact
(due to needing to re-grow the JCasHashMaps, should the class-loader/JCas combo
start to be reused again - an instance of where this might realistically happen
is if PEAR files are being used in a pipeline).
Another possible "fix" is to have uimaFIT know about the lifetime of an
analysis engine, have a new core UIMA API to inform the JCas when a uima
classloader is no longer being used.
Other fixes ?
> Performance degradation of jCas.reset when repeatedly used in different
> analysisEngines
> ---------------------------------------------------------------------------------------
>
> Key: UIMA-5801
> URL: https://issues.apache.org/jira/browse/UIMA-5801
> Project: UIMA
> Issue Type: Bug
> Components: UIMA
> Affects Versions: 2.1
> Reporter: David Bürkle
> Assignee: Marshall Schor
> Priority: Major
> Attachments: JCasPerformanceTest.java
>
>
> The execution time of jCas.reset() increases linearly when invoked on the
> same jCas.
> This occurs in a loop that builds a new analysisEngine, processes the jCas
> and resets it.
> This does not occur when the same analysisEngine is reused.
> A junit test demonstrating the behaviour is attatched.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)