-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
despawn_recursive causing Tracy error #15299
Copy link
Copy link
Closed
Labels
A-DiagnosticsLogging, crash handling, error reporting and performance analysisLogging, crash handling, error reporting and performance analysisA-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Metadata
Metadata
Assignees
Labels
A-DiagnosticsLogging, crash handling, error reporting and performance analysisLogging, crash handling, error reporting and performance analysisA-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Bevy version
0.14.2
What you did
I have a project that involves spawning and despawning many entities. I am having trouble running Tracy with the project because of a Tracy error caused by despawn_recursive.
What went wrong
Tracy errors out because it runs over the limit of systems that can be tracked (32,000).
Additional information
The reason there are over 32,000 systems running is that DespawnRecursive uses the entity that was despawned to create the trace name, creating a unique system to be tracked in Tracy. This can be seen in the Statistics window in Tracy.
I was able to workaround the problem by limiting despawn_recursives, but this only delays the problem, as my project still eventually hits the 32k limit. Changing despawn_recursive to despawn, fixes the issue, but I need despawn_recursive in some places.
Tracy Error
Tracy Statistics, filled with 32,000 unique DespawnRecursive commands
Code causing the problem in
bevy_hierarchy/src/hierarchy.rshttps://github.com/bevyengine/bevy/blob/1bb8007dceb03f41b20317bb44fcdfec1d70513c/crates/bevy_hierarchy/src/hierarchy.rs#L57C1-L81C2