In the current code, we have 3 JBC instances (JCR Cache, JCR Lock and JCR Indexing) per workspace, in PLF we can easily get 12 workspaces or more which means 36 JBC instances which consume a lot of memory and affect the performances, especially in a cluster environment. The idea would be to check how, we can use less instances and rely on cache regions knowing that we can have different Eviction Algorithm per cache region. Since the configuration of the JBC instances of a JCR Cache, JCR Lock and a JCR Indexing don't change much between 2 workspaces, I think that it could be possible to have one JBC Instance for all the JCR caches and same thing for the JCR Indexing and JCR Locks, and those for a given PortalContainer/StandaloneContainer.
We will have to find a good way to compare the configuration in order to ensure a they are the same except the parameters about the eviction. One way to implement it will be to store all the registered Cache in a Map of type <Configuration, Cache>. If a Cache with the same configuration already exists, we use the same cache and add a new Region with the corresponding EvictionAlgorithm.