Project

General

Profile

Actions

bug #7729

open

potential ehcache CacheConfiguration problem

Added by Andreas Kohlbecker about 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
New
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

30%

Estimated time:
Severity:
normal
Found in Version:
Tags:

Description

the below warnings are reported frequently. Interestingly it happens often short before the server freezes due to out of memory problems of the OS. this was more or less coincidental

[phycobank_production] 2018-09-06 17:38:26,835 WARN qtp1321530272-616 [net.sf.ehcache.config.CacheConfiguration] - Cache: eu.etaxonomy.cdm.vaadin.view.name.TaxonNameEditorPresenter436387578 has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client.From Ehcache 2.0 onwards this has been changed to mean a store with no capacity limit. Set it to 1 if you want no elements cached in memory
[phycobank_production] 2018-09-06 17:38:26,976 WARN qtp1321530272-616 [net.sf.ehcache.config.CacheConfiguration] - Cache: cdmModelGetMethodsCache has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client.From Ehcache 2.0 onwards this has been changed to mean a store with no capacity limit. Set it to 1 if you want no elements cached in memory
[phycobank_production] 2018-09-06 17:38:26,999 INFO qtp1321530272-616 [eu.etaxonomy.cdm.cache.CdmTransientEntityCacher] - Cdm Entity with id : 273 already exists in permanent cache. Ignoring put.
[phycobank_production] 2018-09-06 17:38:27,011 INFO qtp1321530272-616 [eu.etaxonomy.cdm.cache.CdmTransientEntityCacher] - Cdm Entity with id : 955 already exists in permanent cache. Ignoring put.
[phycobank_production] 2018-09-06 17:38:27,025 INFO qtp1321530272-616 [eu.etaxonomy.cdm.cache.CdmTransientEntityCacher] - Cdm Entity with id : 790 already exists in permanent cache. Ignoring put.
[phycobank_production] 2018-09-06 17:38:32,615 WARN qtp1321530272-617 [net.sf.ehcache.config.CacheConfiguration] - Cache: eu.etaxonomy.cdm.vaadin.view.reference.ReferenceEditorPresenter76780358 has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client.From Ehcache 2.0 onwards this has been changed to mean a store with no capacity limit. Set it to 1 if you want no elements cached in memory
1
[phycobank_production] 2018-09-06 17:38:48,467 INFO qtp1321530272-617 [eu.etaxonomy.cdm.cache.CdmTransientEntityCacher] - Cdm Entity with id : 273 already exists in permanent cache. Ignoring put.
Actions #1

Updated by Andreas Kohlbecker about 4 years ago

There are a couple of ehcaches being used in the cdmlib and in cdm-vaadin which need different configurations:

1) cdmlib-cache/src/main/java/eu/etaxonomy/cdm/cache/CdmTransientEntityCacher.java

This is pure in memory cache, so the setting maxElementsInMemory = maxEntriesLocalHeap = 0 is correct, TODO: can the warning be suppressed?

    private CacheConfiguration getEntityCacheConfiguration(String cacheId) {
        SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
        sizeOfConfig.setMaxDepth(100);
        sizeOfConfig.setMaxDepthExceededBehavior("abort");

        return new CacheConfiguration(cacheId, 0)
            .eternal(true)
            .statistics(true)
            .sizeOfPolicy(sizeOfConfig)
            .overflowToOffHeap(false);
    }

2) the hibernate caches which use the configuration provided by the cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/config/EhCacheConfiguration.java

CacheConfiguration cc = new CacheConfiguration(CdmCacher.DEFAULT_CACHE_NAME, 500)
                .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
                .maxEntriesLocalHeap(10) // avoid ehache consuming too much heap <<<<< NEW
                .eternal(false)
                // default ttl and tti set to 2 hours
                .timeToLiveSeconds(60*60*2)
                .timeToIdleSeconds(60*60*2)
                .statistics(true);
Actions #2

Updated by Andreas Kohlbecker about 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
Actions #3

Updated by Andreas Kohlbecker about 4 years ago

  • % Done changed from 50 to 30
Actions #4

Updated by Andreas Kohlbecker about 4 years ago

  • Target version changed from Release 5.3 to Release 5.4
Actions #5

Updated by Andreas Kohlbecker about 4 years ago

  • Description updated (diff)
  • Status changed from In Progress to New
  • Target version changed from Release 5.4 to Unassigned CDM tickets
Actions

Also available in: Atom PDF