Deployment Cache: How is "Least recently Used" calculated?

The camunda docs states: camunda-docs-manual/content/user-guide/process-engine/deployment-cache.md at master · camunda/camunda-docs-manual · GitHub

Therefore, after the maximum capacity is reached the least recently used process definition entry is evicted from the cache to satisfy the capacity condition

How is “least recently used” calculated?

Hey dude?! How are you?!

They mean that for example, if you set the maximum capacity to 120… when it reaches 121… the first one will leave to make way for this other one, because the maximum capacity is 120 and cannot exceed this…

This is a “queue” concept.

Explaining it in a simpler way…

The least recently used (oldest cache) will be “deleted” to store this “new cache”.

I believe this is it.
Hope this helps!

Regards.
William Robert Alves.

Hi @StephenOTT,

the implementation relies on the java.util.concurrent.ConcurrentLinkedQueue<K> class.

You can find the Camunda cache implementation here: camunda-commons/ConcurrentLruCache.java at master · camunda/camunda-commons · GitHub

For each get(), the key will be put at the beginning of the queue in lines 59-60

Hope this helps, Ingo