Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up~~Text~~ Image leaks memory #111
Comments
This comment has been minimized.
This comment has been minimized.
|
Coooooool. I love things that should be impossible. One possible bisection: Check whether creating an |
icefoxen
added
bug
Type-CODE
labels
Jul 20, 2017
This comment has been minimized.
This comment has been minimized.
|
Confirmed, though it's more like 5-10 kb per second on my system; about the same results in both debug and release mode. Measured with Persists even when you don't actually draw the text. Valgrind makes the test program segfault for some reason (booo). Replacing the render-text code with just loading an Image gets about the same behavior, so there's the root. The memory consumption appears about the same even regardless of the size of the Image (dragon1.png vs. player.png, 83 kb vs <1 kb). This is rendering at 60 fps and so each load leaks something like 0.25 kb of memory, which is really quite small; it's probably not the image data itself being leaked but some buffer or descriptor inside of gfx-rs. Might be this? gfx-rs/gfx#1054 Only gfx-rs issue that looks likely to be related. To do: Check with newer versions of gfx-rs, maybe the leak has been fixed already. |
icefoxen
changed the title
Text leaks memory
~Text~ Image leaks memory
Jul 20, 2017
icefoxen
changed the title
~Text~ Image leaks memory
~~Text~~ Image leaks memory
Jul 20, 2017
This comment has been minimized.
This comment has been minimized.
iremaildb
commented
Jul 22, 2017
|
I have a similar bug, except occasionally the GPU complains that it has run out of memory, as well so I was thinking that texture handles were getting leaked. FWIW, this is usually ~13min into running my game. What happens is that the text starts failing to render (no errors, despite .unwrap() and ? in all the right places) [the rest of my game is just colored rectangles for now, so they continue working fine] and then a few seconds later, it will occasionally crash with "intel_do_flush_locked" (driver errors). I tried upgrading a checked-out copy of ggez to Out of curiosity, how are resources handled in ggez/gfx? There doesn't appear to be any implementations of Drop in ggez, which means the default drop handlers do the work. I tried looking further into gfx, but got pretty stuck. Is one of those Image types secretly a |
This comment has been minimized.
This comment has been minimized.
|
Yeah most things that are GPU resources (textures, buffers, etc) in gfx-rs generally are just Arc'ed handles. ggez defers almost all actual resource management to the user; it is very seldom that it actually stores something in the Context. Upon inspection the only place where it might store additional info per |
This comment has been minimized.
This comment has been minimized.
igowen
commented
Jul 24, 2017
|
(disclaimer: I'm relatively new to Rust, so I could be completely wrong) it looks like the problem is that |
This comment has been minimized.
This comment has been minimized.
|
afaict these resources should be released with the |
icefoxen
referenced this issue
Jul 24, 2017
Closed
Memory leak when creating texture with opengl backend #1395
This comment has been minimized.
This comment has been minimized.
|
I've finally gotten around to confirming this using bare gfx-rs and punted the bug upstream: gfx-rs/gfx#1395 . Further tracking or troubleshooting should please happen there. |
ozkriff commentedJul 20, 2017
•
edited
Example:
~30Kb per second on my machine