[
https://issues.apache.org/jira/browse/UIMA-4279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14353520#comment-14353520
]
Marshall Schor commented on UIMA-4279:
--------------------------------------
Re: configurable: Is there a use case for this needing to be configurable? At
this point it is not, but if there were a good use case to overcome the
additional complexity that adding configurability would add, we could do that.
Just as an aside, core Java's ArrayList isn't configurable in this aspect (it
always doubles, I believe).
> tune space-time tradeoffs for internal array structures in core uima
> --------------------------------------------------------------------
>
> Key: UIMA-4279
> URL: https://issues.apache.org/jira/browse/UIMA-4279
> Project: UIMA
> Issue Type: Improvement
> Components: Core Java Framework
> Affects Versions: 2.7.0SDK
> Reporter: Marshall Schor
> Assignee: Marshall Schor
> Priority: Trivial
> Fix For: 2.7.1SDK
>
>
> Several internal array structures in UIMA expand like array lists by
> doubling, up to some size, usually 2 million entries, and then expand by
> adding that size (e.g., 2 million) instead of doubling.
> The switch-over point for most of these is 2 million entries. Increasing
> this makes (for large allocations > 2 million) for more wasted space, since,
> on average, about 1/2 of the last reallocation may be unused On the other
> hand, having a large allocation size increment means that fewer reallocations
> are needed (each one requires copying the entries from the old into the new,
> usually with System.arraycopy).
> Given the drop in memory cost, increase the reallocation switch-over limit
> for the 2 million entries to 16 million, to rebalance a bit more in favor of
> speed vs memory. Note this has no effect except when the size of these
> internal tables grows beyond 2 million entries.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)