gfx-rs/wgpu-native

How to interpret RegistryReport

almarklein opened this issue · 0 comments

The RegistryReport entries have fields:

  • num_allocated
  • num_kept_from_user
  • num_released_from_user
  • num_error
  • element_size

But to me it's unclear how to interpret these num values. My first guess was that num_allocated is the cumulative number of objects that have been allocated in this session, while num_released_from_user is the cumulative number of released objects. So num_kept_from_user should be the difference. However, I do see in some cases that kept + released > allocated.

The docs of gpu-core don't help.

Could someone please explain what the values mean? In wgpu-py we use these in diagnostics to measure the number of live objects, and also have tests for this to detect/prevent memory leaks.

I could submit a PR to improve the wgpu-core docs, once I understand how these work :)