Hi guys,

did anyone have the chance to take a look at the problem I described?

I've made some more tests in the meantime and it seems that the GC
doesn't free memory even if the ObjectManagerImpl has just very few
cached objects because of indirect references.
Let me explain this.
Let's say the ObjectManagerImpl holds 4 objects: 1 map and 3 contained
objects (not counting keys), so references size is 4. The CacheManager
performs then the eviction of the 3 objects: the ObjectManagerImpl now
holds just the map object, which still holds the 3 evicted objects, so
even if the references size is 1, there are still 4 objects alive that
the GC can't collect *until* the map is itself evicted.
Is that correct?

Obviously, feel free to ask any questions if my explanation isn't clear enough.

On Mon, Nov 29, 2010 at 9:06 PM, Sergio Bossa <sergio.bo...@gmail.com> wrote:
> Some more updates ...
>
> After several GC cycles, the heap suddenly decreased with no apparent
> reason, freeing all those ObjectID instances.
> So I took a deeper look at the server logs and the heap dumps: I
> noticed that the heap decreased after a cache eviction of just a few
> hundreds objects (which is strange given it previously evicted
> thousand objects with no result), so I took a look at the dumps and
> noticed that objects doesn't have all the same "weight".
> I mean, there are a few objects which seem to hold many other objects
> (ManagedObjectImpl), but the indirect references aren't held by the
> references map in the object manager, so they doesn't seem to count
> against the eviction. In other words, the "references_size()" method
> in ObjectManagerImpl doesn't seem to take into account indirect
> references, so the references size is apparently low, but the actual
> weight is pretty heavy.
>
> I don't know if it makes any sense ... feel free to ask if you have
> any questions ... just take into account I'll be away in the next few
> days so I may answer with some delay.
>
> Cheers!
>
> Sergio B.
>
> On Mon, Nov 29, 2010 at 5:34 PM, Sergio Bossa <sergio.bo...@gmail.com> wrote:
>> Hi guys,
>>
>> while testing my Terracotta-based application I noticed that the
>> master almost saturates its memory (2 GB) with about 5 million map
>> entries, running as a consequence into more and more GC cycles.
>> By analyzing the heap dump I noticed there's a huge number of
>> com.tc.object.ObjectID instances, which is almost equal to the total
>> number of map entries: those objects seems to be retained by the
>> ObjectManagerImpl, and by looking at the source code it seems it
>> actually holds a map of reference objects.
>>
>> So, how does ObjectManagerImpl actually work? Doesn't it flush objects on 
>> disk?
>>
>> --
>> Sergio Bossa
>> http://www.linkedin.com/in/sergiob
>>
>
>
>
> --
> Sergio Bossa
> http://www.linkedin.com/in/sergiob
>



-- 
Sergio Bossa
http://www.linkedin.com/in/sergiob
_______________________________________________
tc-dev mailing list
tc-dev@lists.terracotta.org
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to