Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.1.0-pre.5
Issue ID
1338934
Regression
No
Fair amount of garbage is allocated when using Input System
1. Open the attached project "InputSystemGC2.zip"
2. Open the "SampleScene" Scene
3. Open Profiler (Window > Analysis > Profiler)
4. Enter Play Mode
5. Make sure the Module details panel is in Hierarchy view and the "Live" button is toggled on
6. Hold the left mouse button in the Game view
7. While holding the left mouse button look at the Profiler window
Expected result: No garbage or less garbage gets created
Actual result: Some garbage is created
Reproducible with: 1.0.0 (2019.4.28f1, 2020.3.13f1), 1.1.0-pre.5 (2019.4.28f1, 2020.3.13f1, 2021.1.14f1, 2021.2.0b2, 2022.1.0a1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Resolution Note:
I analyzed the provided deep profile and as highlighted in provided screenshots there is managed dynamic memory allocation happening in frame 74 as clearly stated in this case. Drilling down into the callstack starting from PreUpdate.NewInputUpdate() as root, its possible to see that the dynamic allocation originates from UnityEvent and Mono.JIT as previously elaborated on. However, looking into subsequent frames, e.g. 75, 76, 77 etc GC alloc is zero, i.e. its possible to see that no additional GC Alloc is performed. Stepping forward its visible that any GC Alloc is also either driven by UnityEvent or Mono.JIT. UnityEvents are used for callbacks from the input framework but is outside the implementation of the Input system itself.