<div dir="ltr">Are you sure both representations are kept? <br><br>MarshalledValueInterceptor.visitGetKeyValueCommand() should call MarshalledValue.compact just before returning, which should keep only one representation.<br>

<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 18, 2013 at 3:44 PM, Mircea Markus <span dir="ltr">&lt;<a href="mailto:mmarkus@redhat.com" target="_blank">mmarkus@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We have the following behaviour when storeAsBinary is enabled:<br>
- when an entry is added it is initially stored in binary format (byte[])<br>
- when it is read from an *owning node*, it is unmarshalled and the object reference is cached in memory together with the byte representation<br>
- the object reference is only cleaned up when cache.compact() is invoked explicitly<br>
<br>
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&#39;s quite confusing and not very user friendly as the user needs to be concerned with memory management.<br>


<br>
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.<br>


<br>
Cheers,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Mircea Markus<br>
Infinispan lead (<a href="http://www.infinispan.org" target="_blank">www.infinispan.org</a>)<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</font></span></blockquote></div><br></div>