-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change LRUMap to just evict one entry when maxEntries reached #3530
Comments
Closing as this rehashes #2502 and FasterXML/jackson-module-scala#428. Making the change in the issue description would incolve dropping the ConcurrentHashMap that currently backs LRUMap. |
Makes sense. And just to be clear: the reason |
Hooray! Big thanks to @pjfanning for contributing the implementation and @ben-manes for helping with suggestions. |
Current implementation clears full map when maxEntries reached. jackson-dataformat-csv has its own separate LRUMap[1] and it only evicts the eldest entry when you add a new entry after the maxEntries is reached. Would it be possible to have jackson-databind LRUMap use similar logic? The change would require LRUMap to subclass LinkedHashMap.
[1] https://github.com/FasterXML/jackson-dataformats-text/blob/2.14/csv/src/main/java/com/fasterxml/jackson/dataformat/csv/impl/LRUMap.java
The text was updated successfully, but these errors were encountered: