3

I want to avoid Max Object Graph Size reached for the object : 840 - error . As per this

This element has the following attributes maxDepth – Controls how many linked objects can be visited before the size-of engine takes any action. This attribute is required. maxDepthExceededBehavior – Specifies what happens when the max depth is exceeded while sizing an object graph:

how can this be set in ehcache3 and springboot.Using programmatic config . I am not using xml in springboot for ehcache 3.4

tonio
  • 10,355
  • 2
  • 46
  • 60
user2758406
  • 536
  • 7
  • 16

2 Answers2

2

The behavior was ABORT or CONTINUE. Right now, looking at the code, it does an abort. To get different behavior, you need a custom SizeOfEngine service.

Henri
  • 5,551
  • 1
  • 22
  • 29
1

CacheConfigurationBuilder. withSizeOfMaxObjectSize(100000) helped to solve.

Documentation as below public CacheConfigurationBuilder withSizeOfMaxObjectSize(long size, MemoryUnit unit) Adds or updates the DefaultSizeOfEngineConfiguration with the specified maximum mapping size to the configured builder. SizeOfEngine is what enables the heap tier to be sized in MemoryUnit. Parameters: size - the maximum mapping size unit - the memory unit Returns: a new builder with the added / updated configuration

user2758406
  • 536
  • 7
  • 16