slot management in cached container | developer.brewmp.com slot management in cached container | developer.brewmp.com

Developer

slot management in cached container

I have a cached container that can hold up to 1000 children. The trigml displays only 5 at any given time in a griddata.

Initially when I create the cached container, I set the max item to be 5: IACTORCONTEXT_CreateCacheContainer(context, name, 5, parent, 0, &con );

What I found out, however, is that when I scroll the griddata, the number of children instantiated just keeps growing, without any being released.

In the cache model implementation of CreateChild (in the actor), I also print out the result of IVFSCONTAINER_GetMaxItems, and the number too just keeps growing.

When the trig quits, the whole log of 1000 children gets released.

Is this expected? Isn't the cache container supposed to hold just enough to display in the griddata? Or maybe it depends on the memory available on the device?

Another observation is that my DestroyChild function never gets called before my cached model is released. Is that possible?

Thank you for your time reading through this... Any help is appreciated.

If I remember rightly the cache container keeps growing until (a) it cannot allocate any more memory or (b) it reaches the maximum number of items it can store. The cache just grows until it has reached the maximum (which is hard limited at 65536).
Yes it is largely expected.
The child may disappear if you implement a meaning for DestroyChild routine (not just the {} variant!)

If I remember rightly the cache container keeps growing until (a) it cannot allocate any more memory or (b) it reaches the maximum number of items it can store. The cache just grows until it has reached the maximum (which is hard limited at 65536).
Yes it is largely expected.
The child may disappear if you implement a meaning for DestroyChild routine (not just the {} variant!)

Hi Binkles,
Thanks for your reply. A follow up for:
(b) it reaches the maximum number of items it can store.
Is there a way to set it? I did use the following call trying to set it to 7.
IACTORCONTEXT_CreateCacheContainer(GetActorContext(), name, 7, parent, 0, &con );
And it did not do anything. What's the meaning of the 3rd parameter in the function then?
Thanks,
Jian

Hi Binkles,
Thanks for your reply. A follow up for:
(b) it reaches the maximum number of items it can store.
Is there a way to set it? I did use the following call trying to set it to 7.
IACTORCONTEXT_CreateCacheContainer(GetActorContext(), name, 7, parent, 0, &con );
And it did not do anything. What's the meaning of the 3rd parameter in the function then?
Thanks,
Jian