-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Scenario
- Load millions of
TransformGroupobjects into specificLocalesin two-level hierarchy.
- Locale
- TransformGroupRetained X
- GroupRetained
- TransformGroupRetained A... (millions of object in this level)
- TransformGroupRetained B... (millions of object in this level)
- Call
VirtualUniverse.removeAllLocales. We will find the$O(N^2)$ time during release resource.
Reason
| obj.remove(this); |
TransformGroupRetained.removeNodeData will call parent TransformGroupRetained X childTransformLinks.remove step by step.
Possible Solution
Predict the live state from parent class NodeRetained.
| void clearLive(SetLiveState s) { |
| void clearLive(SetLiveState s) { |
// in TransformGroupRetained.
@Override
void clearLive(SetLiveState s) {
Targets[] savedTransformTargets = null;
savedTransformTargets = s.transformTargets;
// no need to gather targets from tg in clear live
s.transformTargets = null;
if (refCount - s.refCount <= 0) { // predict live to prevent children update.
childTransformLinks.clear();
}
super.clearLive(s);
...Metadata
Metadata
Assignees
Labels
No labels