Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Profiling Support #6927

Open
james7132 opened this issue Dec 12, 2022 · 2 comments
Open

Memory Profiling Support #6927

james7132 opened this issue Dec 12, 2022 · 2 comments
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Feature A new feature, making something new possible

Comments

@james7132
Copy link
Member

james7132 commented Dec 12, 2022

What problem does this solve or what need does it fill?

The 3d_scene example currently uses 107.5 MB of resident memory on my machine, even with all of the optimizations enabled. For a simple rendered scene of a box and a plane, I'd expect that to be lower. To better address this, it's important to be able to profile and monitor the memory behavior of Bevy apps.

What solution would you like?

Either better docs or tooling for the following:

  • Live memory snapshotting: finding what is allocating, how big are the allocations, what feature is it tied to.
  • Allocation behaviors: When are allocations being allocated, when are they being freed?
  • Cache behaviors: L1/L2/L3 cache hit rates.

For best platform support, this ideally should also support doing this remotely, though this might be dependent on platform specific tooling.

What alternative(s) have you considered?

Blindly start shrinking data structures and cutting dependencies until memory usage goes down.

@james7132 james7132 added C-Feature A new feature, making something new possible A-Diagnostics Logging, crash handling, error reporting and performance analysis labels Dec 12, 2022
@hymm
Copy link
Contributor

hymm commented Dec 12, 2022

I was able to use https://crates.io/crates/leak-detect-allocator to find the memory leak fixed in #6878. It shows all the stuff that was allocated without a matching deallocation. But a lot of allocations don't show up since some things are allocated and deallocated during a single frame. Bevy does runs at like 0.1 FPS when using it though, so might not be suitable for a lot of applications.

@hymm
Copy link
Contributor

hymm commented Jan 4, 2023

ran into https://crates.io/crates/dhat and https://github.com/koute/bytehound. That might be worth looking at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

2 participants