clarkezone / audiovisualizer

A UWP audio visualization component that provides a stream analyzer and XAML visualization controls for displaying VU and spectrum meters powered by Win2D
MIT License
122 stars 26 forks source link

Memory leak #74

Open hig-dev opened 5 years ago

hig-dev commented 5 years ago

Steps to reproduce:

Hint: You have to enable native profiling and disable Just My Code in the memory profiling settings.

  1. Debug the sample app "VisualizationPlayer" with memory profiling
  2. Open a music file
  3. Force GC and make memory snapshot
  4. Repeatedly open the same or another music file. On every new opening of a music file the memory usage will increase. Do this 5-10 times.
  5. Force GC and make memory snapshot
  6. You will see that the memory usage has increased a lot.

Screenshot: image

Link to diagsession (300MB): https://send.firefox.com/download/f52b09a111a056c9/#2wL5zmgjieB-jPciQQTAcg

hig-dev commented 5 years ago

I now found the exact source of the memory leak, after opening a music file, a new ring buffer will be allocated and the old one won't be released from memory: image

Better diagsession (275MB): https://send.firefox.com/download/d5a2a65ca2046481/#ZZYWME7FDG5vUhWMZkZ5wg