[
https://issues.apache.org/jira/browse/OAK-445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jukka Zitting resolved OAK-445.
-------------------------------
Resolution: Fixed
Fix Version/s: 0.6
Nice. The logic is similar to what we have also in the HashCache class in
spi-commons from JCR-1663.
I added something like this in revision 1409456 where I made all JSON tokens
processed by KernelNodeState go through either "new String()" (for hashes, blob
ids, etc.) or the new "StringCache.new()" method that combines the above hash
cache idea with a static set of known constants. The StringCache also takes
care of using "new String()" where needed to avoid the substring problem.
Also, FTR, the substring issue is discussed in more detail at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513622.
> Allow JSON strings to be reclaimed after they've been parsed
> ------------------------------------------------------------
>
> Key: OAK-445
> URL: https://issues.apache.org/jira/browse/OAK-445
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
> Assignee: Jukka Zitting
> Priority: Minor
> Fix For: 0.6
>
>
> Currently the JsopTokenizer uses String.substring() when returning various
> tokens. This can be a bit troublesome as the returned String instances often
> keep a reference to the full underlying JSON string, which prevents that one
> from being reclaimed.
> It would also be nice if the tokenizer automatically detected common tokens
> like "jcr:primaryType" or "nt:unstructured" and use flyweight instances to
> avoid too many duplicate copies of such strings.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira