Memory Continuously Increases After Using AddProfiler Method - Bug
Version: Stride 4.2.0.2282, Stride.CommunityToolkit 1.0.0-preview.48
Body:
I have encountered a bug where memory usage continuously increases after using the AddProfiler method. Please refer to the attached image for details.
Operating System: Windows 11 Description: After invoking the AddProfiler method, the memory usage has increased by approximately 400MB. Expected Behavior: The memory usage should remain stable or only increase slightly when using the AddProfiler method. Actual Behavior: The memory usage significantly increases by around 400MB after the AddProfiler method is called. Environment: Operating System: Windows 11 Stride Version: 4.2.0.2282 Stride.CommunityToolkit Version: 1.0.0-preview.48 Steps to Reproduce: Implement the AddProfiler method in the project. Monitor the memory usage before and after the method is called. Observe the continuous increase in memory usage. Screenshots: [Please see the attached image for the memory usage graph.] Additional Context: This issue occurs consistently every time the AddProfiler method is used.
Please let me know if you need any further information to address this issue. Thank you.
@Doprez, can you recall there was some conversation on this subject? Doesn't profiler record something?
I dont know if there was ever a conversation but this is definitely not normal for the profiler. There will be an increase in memory consumption but it gets cleaned up when I use the default GameProfiler that GameStudio creates.
7 minutes of running and it seems fine for me. It is slowly rising but only by 5MB over the time frame.
@jkh404 Can you try this this with the the default GameStudio script and if the same issue occurs then we should add it as an issue in the main repo. https://doc.stride3d.net/4.2/en/manual/troubleshooting/profiling.html
I did have some serious memory consumption issues with https://github.com/stride3d/stride/pull/1788 but that should be unrelated to this since they work differently.
@Doprez
Okay, I tried as you suggested, and the result is similar to yours, the memory is under control. But I noticed a new issue, that is, there is a more frequent GC (each pause is 0.5ms-0.7ms, even when the screen is static), which might affect the accuracy of the game performance analyzer. Do you think we need to improve this issue?
I did notice that there was a lot of GC allocations. I would consider this an issue to look into but fairly minor as it hasn't affected heavier loads in my experience. Its pretty easy to see when its an issue with project code even with the allocations.
I added an issue to the main repo for further tracking. https://github.com/stride3d/stride/issues/2587
If you want to try and use a different profiler you can look into the ImGUI part of the toolkit. I did not notice the same GC pressure from that. Just a heads up though, you may have to reference source as there is an issue with how the shaders compile from the toolkit.