-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Hello,
I'm currently looking at heap consumption when using native image with a Spring Boot 3 application. Spring Boot 3.0 SNAPSHOT uses Jackson 2.14.0-rc3. I noticed that with the upgrade from 2.13.4.2 to 2.14.0 the application uses more heap memory, which i tracked down to this PR. It changed the cache implementation from ConcurrentHashMap
to PrivateMaxEntriesMap
, which in turn preallocates a lot of AtomicReference
(they appear to be all empty).
I created a reproducer here - it creates an empty objectmapper and then dumps the heap. It has more information and screenshots in the README.
When using Jackson 2.13.4.2 it uses 567 B for the LRUmap, with Jackson 2.14.0 it uses 507320 B for the LRU map. The bad thing is that most of these caches are per ObjectMapper
- create more of them and it uses even more heap.
As we're trying to optimize the memory consumption of native image applications, this is quite a bummer and we hope you can help us out here.
Thanks!