You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each space view and container produces a unique entity in the blueprint store.
If the users decides to remove a view or a container, we still keep its entity in the blueprint store, so that they can undo their action.
Over time, this can fill up the store with a lot of "legacy" entities, that are older than the undo buffer, but that cannot be collected by the GC. That's because the GC of the blueprint store is configured to always keep the last component of each entity. This is important, or we would forget about things in the blueprint that hasn't changed in a while.
I see two potential solution to this:
Mark-and-sweep (bespoke and complicated user-space solution)
We haver an explicit mark-and-sweep-pass where we mark everything that is reachable from any root container in the undo buffer.
This requires visiting all root containers in the undo buffer, and then recursively visiting all their children, at the right time step (the one of the root container), and then marking anything reached.
Clear-aware store GC (the nice and reusable solution)
When a user deletes a container or view, we log a recursive clear (that was already added in #7546 in anticipation of this issue). If we could make the store GC aware of clear, we could configure it to do something like the following:
If protect_latest=1, and the last thing logged is a recursive clear, that only keep that clear
In a separate step, remove all entities that has no components in the store, excepting clears
Thus the recursive clear would be a signal to the store GC that "if everything before the clear has been garbage-collected, then you can remove the whole entity". Of course this should configurable in GarbageCollectionOptions
The text was updated successfully, but these errors were encountered:
Each space view and container produces a unique entity in the blueprint store.
If the users decides to remove a view or a container, we still keep its entity in the blueprint store, so that they can undo their action.
Over time, this can fill up the store with a lot of "legacy" entities, that are older than the undo buffer, but that cannot be collected by the GC. That's because the GC of the blueprint store is configured to always keep the last component of each entity. This is important, or we would forget about things in the blueprint that hasn't changed in a while.
I see two potential solution to this:
Mark-and-sweep (bespoke and complicated user-space solution)
We haver an explicit mark-and-sweep-pass where we mark everything that is reachable from any root container in the undo buffer.
This requires visiting all root containers in the undo buffer, and then recursively visiting all their children, at the right time step (the one of the root container), and then marking anything reached.
Clear-aware store GC (the nice and reusable solution)
When a user deletes a container or view, we log a recursive clear (that was already added in #7546 in anticipation of this issue). If we could make the store GC aware of clear, we could configure it to do something like the following:
protect_latest=1
, and the last thing logged is a recursive clear, that only keep that clearThus the recursive clear would be a signal to the store GC that "if everything before the clear has been garbage-collected, then you can remove the whole entity". Of course this should configurable in
GarbageCollectionOptions
The text was updated successfully, but these errors were encountered: