Memory leak issue due to EHCache
Asked Answered
B

1

6

I am facing memory leak issue in my performance environment due to EhCache with below configuraiton:

<cache name="mycache"
            maxElementsInMemory="50000"
            eternal="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="0"
            overflowToDisk="false"
            diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"
            />                

I took the heap dump and trying to analyze the cause of leak using IBM Heap Analyzer. IBM Heap analyzer suspected memory leak with below information:

Leak suspect:   576,690,536 bytes (83.16 %) of Java heap is used by 128 instances of net/sf/ehcache/store/chm/SelectableConcurrentHashMap$Segment
Contains an instance) of the leak suspect: - org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean holding 117,109,616 bytes at 0x1b6fb410

Total size: 576,690,536 bytes

Size:   528 bytes

My object (which is stored in ehcache) size is 88 bytes.

With this information I am not able to understand what can be the actual cause of memory leak in this case.

Are my objects not being flushed/removed from cache? Is there any thing odd in my ehcache configuration? If object is not being removed from cache, what can be the reason?

Any Idea?

Birthmark answered 21/11, 2013 at 10:34 Comment(1)
I think this question is similar to yours: #8595992 I'm no expert of ehcache but did you try to update it to the latest version?Dowski
P
0

Set timeToLiveSeconds = <no of seconds>. Should be greater than 0.

Pane answered 8/11, 2018 at 10:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.