[ 
https://issues.apache.org/jira/browse/SAMZA-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jagadish closed SAMZA-1370.
---------------------------

> Memory leak in CachedStore when using ByteBufferSerde as key serde
> ------------------------------------------------------------------
>
>                 Key: SAMZA-1370
>                 URL: https://issues.apache.org/jira/browse/SAMZA-1370
>             Project: Samza
>          Issue Type: Bug
>            Reporter: Prateek Maheshwari
>            Assignee: Prateek Maheshwari
>             Fix For: 0.13.1
>
>
> ByteBufferSerde uses relative bulk get to serialize the provided ByteBuffer 
> which changes its internal position. ByteBuffer's `equals` and `hashCode` 
> depend upon its remaining elements, i.e. on its position. This means that 
> when using ByteBuffers as keys in the CachedStore, flushing cache contents to 
> the underlying store changes their hashCode. Since the hashCode for the key 
> no longer matches the one used when inserting it into the map, the 
> LinkedHashMap cannot correctly evict or remove these entries, leading to a 
> memory leak.
> Changing ByteBufferSerde to use absolute get operations or duplicate the 
> provided ByteBuffer before copying should fix this issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to