You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Achanta Vamsi <ac...@phonepe.com> on 2019/02/12 19:03:20 UTC

Queries regarding the Java ResolvingDecoder cache

Hi,

Currently in GenericDatumReader, whenever a ResolvingDecoder is
constructed, a ThreadLocal cache with a WeakHashMap is used to cache the
resolver. The getResolver() api is currently marked as Unstable.

In a scenario when the Schemas are huge (10^6 chars and deeply nested) and
there are lots of threads, this leads to lot of memory usage and frequent
garbage collections.

Could someone help me with how to go about in such a scenario - can we
write a concurrent cache with still Identity values and be functionally
correct?
Or should I use a limited no of threads always when using
GenericDatumReader so that the memory increase is controlled?

Please suggest.
-- 
Thanks
Vamsi