We have a JVM heap issue in the production server. When we took the heap dump and analyzed the report, we found that more than 80% of the heap size is exhausted by the Ehcache objects and server become slow. We have suspected that memory leak or accumulating the cache objects without clearing the old caches. The site is very high volume site hence the number of caches would have increased.
I want to review the meaning of this configurations and suggest if this has something to do with that issue:
<ehcache>
<diskStore path="java.io.tmpdir" />
<defaultCache maxElementsInMemory="10" eternal="false"
timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" />
<cache name="name1" maxElementsInMemory="50" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" />
<cache name="name2" maxElementsInMemory="50" eternal="false" overflowToDisk="true" timeToIdleSeconds="0" timeToLiveSeconds="86400" />
<cache name="name3" maxElementsInMemory="50000" eternal="true" overflowToDisk="true"/>
<cache name="name4" maxElementsInMemory="500" eternal="true" overflowToDisk="true"/>
<cache name="name5" maxElementsInMemory="500" eternal="true" overflowToDisk="true"/>
<cache name="name6" maxElementsInMemory="50000" eternal="true" overflowToDisk="true"/>
<cache name="name7" maxElementsInMemory="50000" eternal="true" overflowToDisk="true"/>
</ehcache>
In the Java class I have the following implementation:
@Cacheable("name6")
public ServiceResponse getQualifiedProducts(
ValueObject parameterObject, List < Input > list)
{
return cachedService.getQualifiedProducts(parameterObject, list);
}
Any suggestions would be thankful.
Update: What is the significance of overflowToDisk="true". I don't have any disk store configured. How it will impact the performance?