Project

General

Profile

bug #7729

potential ehcache CacheConfiguration problem

Added by Andreas Kohlbecker 9 months ago. Updated 7 months ago.

Status:
New
Priority:
New
Category:
cdmlib
Target version:
Start date:
09/06/2018
Due date:
% Done:

30%

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.

Associated revisions

Revision 8b9e2e71 (diff)
Added by Andreas Kohlbecker 9 months ago

ref #7729 setting maxEntriesLocalHeap for the cdmDefaultCache and activating ehcache jmx management beans for the CdmTransientEntityCacher

Revision 0af671fa (diff)
Added by Andreas Kohlbecker 9 months ago

ref #7729 removing unused ehcache.xml - all config is code based

Revision cf4ebe93 (diff)
Added by Andreas Kohlbecker 9 months ago

ref #7729 removing unused ehcache.xml - all config is code based

Revision 3cee4d12 (diff)
Added by Andreas Kohlbecker 3 months ago

ref #7729 suppress nasty ehcache OutOfMemory warnings to reduce clutter in the server log

History

#1 Updated by Andreas Kohlbecker 9 months 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);

#2 Updated by Andreas Kohlbecker 9 months ago

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

#3 Updated by Andreas Kohlbecker 9 months ago

  • % Done changed from 50 to 30

#4 Updated by Andreas Kohlbecker 8 months ago

  • Target version changed from Release 5.3 to Release 5.4

#5 Updated by Andreas Kohlbecker 7 months ago

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

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)