Components setup/release lifecycle

17 views
Skip to first unread message

vianney...@dooapp.com

unread,
Jul 30, 2015, 8:22:33 AM7/30/15
to JRebirth Users
Hi Seb,

I have a question about components setup/release lifecycle.

In 7.7.0 when a model was released its key was set to null. This caused the component being garbage collectable from the componentMap. Until this garbage collection the component could still be retrieve.
In 8.0.x the component is unregister from AbstractFacade and will be remove from the componentMap at this moment. So next times the component will be use it will be rebuild from zero. So it seems to me we lost optimization here.

Did I miss something or did the system change that way ?

Sebastien Bordes

unread,
Jul 30, 2015, 9:06:17 AM7/30/15
to jrebirth-users
Within 7.7.0 version there were some leaks when Component was listening some WaveType, in this case they were retained by the Notifier and can't be garbage collected.

Within 8.x version the contract is more clear, when the Component is released, all strong references (put by JRebirth, noth those put by developer) are removed and the component and its key are destroyed and removed from all map.

If you want to keep Component into memory, don't release it, only Components without strong references (and so who don't listen any WaveType) could be garbage collected.

For instance, a command used once will be garbage collected, the key will be still present into the component map and allow to keep the component if the memory is not contrained, if gc has remove it it will be re-created on demand.


Idem for Services.

Models are more subtle to manage because they strongly link a Node (directly or indirectly depending on the kind of Model, creating a chain of strong reference), so if you want to keep in memory some Models we should find a way to avoid the release phase.

Are you in line with that ?

Seb

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "JRebirth Users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages