-
Notifications
You must be signed in to change notification settings - Fork 180
wgpu memory leak #299
Comments
Thank you for filing this! |
Thats good news 😄. I have another (extremely nasty) memory leak that only surfaces in a multi-threaded context. I'm hoping fixing this issue also fixes that one. |
Repro for the multi-threaded issue here: https://github.com/cart/wgpu-rs/tree/multi-threaded-leak It leaks in the hundreds of MBs within seconds. |
and if it helps, here is the jemalloc prof pdf for the multithreaded example (which also has RawPass.ensure_extra_size as the hot spot) |
Aren't both of these the same? |
The pdfs are slightly different (note the crossbeam function calls). Your changes fixed the original issue! They also vastly improved app shutdown time (which would sometimes hang for a second when quitting). Sadly the multi-threaded issue remains. I can still repro it on the branch above (which i rebased onto the latest changes). Should I open a new issue? |
Please, yes!
… On May 5, 2020, at 22:26, Carter Anderson ***@***.***> wrote:
The pdfs are slightly different (note the crossbeam function calls).
Your changes fixed the original issue! They also vastly improved app shutdown time (which would sometimes hang for a second when quitting).
Sadly the multi-threaded issue remains. I can still repro it on the branch above (which i rebased onto the latest changes).
Should I open a new issue?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks for the quick response! |
I have observed in both the "cube" example and my own personal project that wgpu programs slowly increase the amount of memory they are using over time (in what appears to be an unbounded fashion). Generally this is about 0.5 MB per second. On my machine the cube example starts at around 10 MB. I left for a bit and came back to it using over 200 MB.
I did some memory profiling by setting the allocator to jemalloc (from the jemallocator crate) with the
profiling
feature enabled.I ran the example with this command and let it run for a bit:
This dumped a *.heap file (attached), which i converted to a pdf (also attached) using the following command;
This seems to point to

wgpu_render_pass_set_pipeline
generating the memory (specifically a call toRawPass.ensure_extra_size
)jeprof.2090320.0.f.heap.txt
out.pdf
The text was updated successfully, but these errors were encountered: