My application is a web socket client that continuously parses JSon using Jackson 2.9.4. I am experiencing a memory leak with SoftReferences in Thread Local not being cleared.
I have configured Jackson to NOT use a Thread Local as follows:
JsonFactory factory = new JsonFactory();
factory = factory.disable(JsonFactory.Feature.USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING);
objectMapper = new ObjectMapper(factory);
But despite this setting, I keep seeing increases in char[] referenced by BufferRecycler:
This takes up around 40% of the physical memory and keeps growing, regardless of memory pressure, until I run out of physical memory.
- How can I disable the use of Thread Local by Jackson?
- What causes this BufferRecycler reference to be kept in memory?
Thanks,
Stik