[infinispan-dev] storeAsBinary keeps both the object and the byte[] - why?

Dan Berindei dan.berindei at gmail.com
Thu Jul 18 09:08:30 EDT 2013


Are you sure both representations are kept?

MarshalledValueInterceptor.visitGetKeyValueCommand() should call
MarshalledValue.compact just before returning, which should keep only one
representation.



On Thu, Jul 18, 2013 at 3:44 PM, Mircea Markus <mmarkus at redhat.com> wrote:

> Hi,
>
> We have the following behaviour when storeAsBinary is enabled:
> - when an entry is added it is initially stored in binary format (byte[])
> - when it is read from an *owning node*, it is unmarshalled and the object
> reference is cached in memory together with the byte representation
> - the object reference is only cleaned up when cache.compact() is invoked
> explicitly
>
> Assuming a key is read uniformly on all the nodes, after a while the
> system ends up with all the entries stored twice: the byte[] and the object
> in unserialized form. Of course this can be mitigated by asking the users
> to invoke Cache.compact - but that's quite confusing and not very user
> friendly as the user needs to be concerned with memory management.
>
> Can anybody think of some reasons why the value is kept twice? I mean
> besides optimising for local gets, which I think is not a good enough
> reason given the potentially huge memory consumption and the complexity
> added.
>
> Cheers,
> --
> Mircea Markus
> Infinispan lead (www.infinispan.org)
>
>
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20130718/3d034fde/attachment.html 


More information about the infinispan-dev mailing list