[ 
https://issues.apache.org/jira/browse/OAK-3112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marcel Reutegger updated OAK-3112:
----------------------------------
    Attachment: OAK-3112.patch

Attached patch implements a HybridMapFactory, which switches from in-memory to 
MapDB and back when the size reaches given thresholds. I had to use 
WeakReferences to track map instances backed by MapDB to only dispose them when 
there are no more references to the map. E.g. it may happen that the map is 
switched back to in-memory, but the MapDB map is still in use by an iterator 
referencing it. HybridMapFactory is set as the default implementation, but can 
be disabled with a feature flag.

This patch is for the 1.0 branch only, because in 1.2 and trunk 
UnsavedModifications doesn't have a dependency to MapDB anymore.

[~chetanm], could you please review?

> Performance degradation of UnsavedModifications on MapDB
> --------------------------------------------------------
>
>                 Key: OAK-3112
>                 URL: https://issues.apache.org/jira/browse/OAK-3112
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, mongomk
>    Affects Versions: 1.0.7, 1.0.8, 1.0.9, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 
> 1.0.14, 1.0.15, 1.0.16, 1.0.17
>            Reporter: Marcel Reutegger
>            Assignee: Marcel Reutegger
>              Labels: performance
>             Fix For: 1.0.18
>
>         Attachments: OAK-3112.patch
>
>
> UnsavedModifications performance degrades when used in combination with the 
> MapDB backed MapFactory. Calls become more and more expensive the longer the 
> instance is in use. The is caused by a limitation of MapDB, which does not 
> remove empty BTree nodes.
> A test performed with random paths added to the map and later removed again 
> in a loop shows a increase to roughly 1 second to read keys present in the 
> map when the underlying data file is about 50MB in size.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to